diff options
author | Tomás Touceda <chiiph@leap.se> | 2014-01-17 15:55:09 -0300 |
---|---|---|
committer | Tomás Touceda <chiiph@leap.se> | 2014-01-17 15:55:09 -0300 |
commit | 7e79576ce81ebfb055947e987355a43c8b050f0f (patch) | |
tree | 52db8ce08c26d079823477fb7875a78a883a67cd /src/leap/mail/imap/messages.py | |
parent | 6dee4ec9790f25335d18ec3b13b7df45d2a8c98f (diff) | |
parent | 98fa323ef8220a6ca330972e45ee56e811c03f69 (diff) |
Merge remote-tracking branch 'refs/remotes/ivan/bug/handle-unicode-characters' into develop
Diffstat (limited to 'src/leap/mail/imap/messages.py')
-rw-r--r-- | src/leap/mail/imap/messages.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/leap/mail/imap/messages.py b/src/leap/mail/imap/messages.py index 7a21009..d2c0950 100644 --- a/src/leap/mail/imap/messages.py +++ b/src/leap/mail/imap/messages.py @@ -532,8 +532,8 @@ class LeapMessage(fields, MailParser, MBoxParser): if not charset: charset = self._get_charset(body) try: - body = body.decode(charset).encode(charset) - except (UnicodeEncodeError, UnicodeDecodeError) as e: + body = body.encode(charset) + except UnicodeError as e: logger.error("Unicode error {0}".format(e)) body = body.encode(charset, 'replace') |