提交 205bed02 编写于 作者: N nicolargo

Force string in Python3 to ascii convertion

上级 54b61fd5
......@@ -65,8 +65,8 @@ if PY3:
"""Convert the bytes string to a ASCII string
Usefull to remove accent (diacritics)"""
if isinstance(s, binary_type):
return s
return s.encode('ascii', 'ignore')
return s.decode()
return s.encode('ascii', 'ignore').decode()
def listitems(d):
return list(d.items())
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册