From 9d645b0b55dced99aaf2797056f18a7d6d9f3127 Mon Sep 17 00:00:00 2001 From: Danimar Ribeiro Date: Mon, 19 Dec 2016 09:23:53 -0200 Subject: [PATCH] =?UTF-8?q?Fazendo=20uma=20convers=C3=A3o=20simples=20para?= =?UTF-8?q?=20evitar=20erros=20de=20unicode?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pytrustnfe/xml/filters.py | 2 ++ setup.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/pytrustnfe/xml/filters.py b/pytrustnfe/xml/filters.py index f18e94b..a9ed689 100644 --- a/pytrustnfe/xml/filters.py +++ b/pytrustnfe/xml/filters.py @@ -24,6 +24,8 @@ def normalize_str(string): def strip_line_feed(string): if string: + if not isinstance(string, unicode): + string = unicode(string, 'utf-8', 'replace') remap = { ord(u'\t'): u' ', ord(u'\n'): u' ', diff --git a/setup.py b/setup.py index d3cf3a2..5efc48d 100644 --- a/setup.py +++ b/setup.py @@ -1,7 +1,7 @@ # coding=utf-8 from setuptools import setup, find_packages -VERSION = "0.1.11" +VERSION = "0.1.12" setup( name="PyTrustNFe",