diff options
author | Kali Kaneko <kali@leap.se> | 2013-11-07 20:42:23 -0200 |
---|---|---|
committer | Kali Kaneko <kali@leap.se> | 2013-11-08 08:48:42 -0200 |
commit | 3b2763b738939c605c3d4480501fde4463c0f2eb (patch) | |
tree | 14a5587fca2a2ead1455e7af70853dd8871b51e6 /client/src/leap | |
parent | 7dc16ac9286f0383c158e6028a028d99c5b1f373 (diff) |
default detected encoding to utf-8
Diffstat (limited to 'client/src/leap')
-rw-r--r-- | client/src/leap/soledad/client/__init__.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/client/src/leap/soledad/client/__init__.py b/client/src/leap/soledad/client/__init__.py index 534040ef..a159d773 100644 --- a/client/src/leap/soledad/client/__init__.py +++ b/client/src/leap/soledad/client/__init__.py @@ -847,8 +847,9 @@ class Soledad(object): elif isinstance(content, str): try: result = chardet.detect(content) - content = content.decode(result["encoding"]).encode("utf-8")\ - .decode("utf-8") + default = "utf-8" + encoding = result["encoding"] or default + content = content.decode(encoding) except UnicodeError: pass return content |