summaryrefslogtreecommitdiff
path: root/client/src/leap/soledad
diff options
context:
space:
mode:
authorTomás Touceda <chiiph@leap.se>2013-11-08 08:41:11 -0300
committerTomás Touceda <chiiph@leap.se>2013-11-08 08:41:11 -0300
commit930b7cd7e56440b638bd646b288f33063e15f3d0 (patch)
tree52175fa928df90b94232ca818e7b426820d7cbc5 /client/src/leap/soledad
parentb79d7f0ef6bc8bb52a6f73d97b64c383e895ebc7 (diff)
parent3b2763b738939c605c3d4480501fde4463c0f2eb (diff)
Merge remote-tracking branch 'kali/bug/default-detected-encoding-to-utf8' into develop
Diffstat (limited to 'client/src/leap/soledad')
-rw-r--r--client/src/leap/soledad/client/__init__.py5
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