summaryrefslogtreecommitdiff
path: root/src/leap/mail/imap/messages.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/leap/mail/imap/messages.py')
-rw-r--r--src/leap/mail/imap/messages.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/leap/mail/imap/messages.py b/src/leap/mail/imap/messages.py
index 22de356..28bd272 100644
--- a/src/leap/mail/imap/messages.py
+++ b/src/leap/mail/imap/messages.py
@@ -494,8 +494,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')