summaryrefslogtreecommitdiff
path: root/alot
diff options
context:
space:
mode:
authorPatrick Totzke <patricktotzke@gmail.com>2011-10-22 15:55:18 +0100
committerPatrick Totzke <patricktotzke@gmail.com>2011-10-22 15:55:18 +0100
commita813c0d8f4512009d0a91d4fa0639a67ee580880 (patch)
tree6f5a5440fcdbfb21ef624dafb93109a624a2b584 /alot
parenta9246fbc5684a3b15e04cd92e5b9c1bfdc3cb4b8 (diff)
deal with already converted unicode strings
Diffstat (limited to 'alot')
-rw-r--r--alot/helper.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/alot/helper.py b/alot/helper.py
index 76183da3..05f7be66 100644
--- a/alot/helper.py
+++ b/alot/helper.py
@@ -49,8 +49,10 @@ def string_decode(string, enc='ascii'):
enc = 'ascii'
try:
string = unicode(string, enc, errors='replace')
- except LookupError:
+ except LookupError: # malformed enc string
string = string.decode('ascii', errors='replace')
+ except TypeError: # already unicode
+ pass
return string