From d7885df45a1391113257960e249fd14169e30f62 Mon Sep 17 00:00:00 2001 From: Gabriel Balog Date: Thu, 8 Feb 2018 11:01:04 -0200 Subject: [PATCH] 3: Auto stash before merge of "master3" and "origin/master3" --- pytrustnfe/xml/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pytrustnfe/xml/__init__.py b/pytrustnfe/xml/__init__.py index 5a848b2..89279e9 100644 --- a/pytrustnfe/xml/__init__.py +++ b/pytrustnfe/xml/__init__.py @@ -58,7 +58,8 @@ def render_xml(path, template_name, remove_empty, **nfe): def sanitize_response(response): - response = re.sub('encoding="UTF-8"', '', response) + if 'encoding="utf-8"' in response or 'encoding="UTF-8"' in response: + response = re.sub('encoding="UTF-8"', '', response) tree = etree.fromstring(response) # Remove namespaces inuteis na resposta for elem in tree.getiterator():