Fixing encoding issue.

This commit is contained in:
Antoine Nguyen
2013-04-25 21:46:51 +02:00
parent 55964c39cb
commit c726c01ea3
+3
View File
@@ -225,6 +225,9 @@ class ImapEmail(Email):
value = getattr(IMAPheader, "parse_%s" % key)(msg[name], full=addrfull)
except AttributeError:
value = msg[name]
result = chardet.detect(value)
if result['encoding'] != 'ascii':
value = value.decode(result['encoding'])
if hdr[1]:
self.headers += [{"name" : label, "value" : value}]
try: