diff --git a/addon.xml b/addon.xml index 5b91e2b..2ad983b 100644 --- a/addon.xml +++ b/addon.xml @@ -1,5 +1,5 @@ - + diff --git a/lib/pyrrent2http/util.py b/lib/pyrrent2http/util.py index e4e318d..e548b16 100644 --- a/lib/pyrrent2http/util.py +++ b/lib/pyrrent2http/util.py @@ -49,14 +49,14 @@ def unicode_msg(tmpl, args): return msg % tuple(arg_) def encode_msg(msg): - msg = isinstance(msg, unicode) and msg.encode(True and sys.getfilesystemencoding() or 'utf-8') or msg + msg = isinstance(msg, unicode) and msg.encode(sys.getfilesystemencoding() != 'ascii' and sys.getfilesystemencoding() or 'utf-8') or msg return msg def localize_path(path): if not isinstance(path, unicode): path = path.decode(chardet.detect(path)['encoding']) if not sys.platform.startswith('win'): - path = path.encode(True and sys.getfilesystemencoding() or 'utf-8') + path = path.encode(sys.getfilesystemencoding() != 'ascii' and sys.getfilesystemencoding() or 'utf-8') return path def can_bind(host, port):