fix unicode issues
This commit is contained in:
parent
0e4f89162e
commit
a42f75700a
2 changed files with 7 additions and 4 deletions
|
|
@ -38,7 +38,10 @@ def to_unicode(text):
|
|||
if isinstance(text, unicode):
|
||||
return text
|
||||
if not isinstance(text, str):
|
||||
text = str(text)
|
||||
try:
|
||||
text = str(text)
|
||||
except UnicodeError:
|
||||
return unicode(text)
|
||||
try:
|
||||
return unicode(text, "utf8")
|
||||
except UnicodeError:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue