summaryrefslogtreecommitdiff
path: root/service/pixelated
diff options
context:
space:
mode:
authorFábio Pio <fpio@thoughtworks.com>2014-12-17 14:07:42 -0200
committerFábio Pio <fpio@thoughtworks.com>2014-12-17 14:10:51 -0200
commit8d71694e252aa517a696403327dae594b43744c0 (patch)
treec649cb312fc61a82b8eaf045f5912411298a2bc3 /service/pixelated
parent200ad7d4a5b5f39717c81eb6a9ad3844044b037c (diff)
Fixed #199 base64 detection won't break plain text
Body will always return unicode now
Diffstat (limited to 'service/pixelated')
-rw-r--r--service/pixelated/adapter/mail.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/service/pixelated/adapter/mail.py b/service/pixelated/adapter/mail.py
index 847773b7..b6b566bb 100644
--- a/service/pixelated/adapter/mail.py
+++ b/service/pixelated/adapter/mail.py
@@ -211,8 +211,8 @@ class PixelatedMail(Mail):
body += '--' + self.boundary + '--'
return body
else:
- if self.parts and self.parts['alternatives'][0]['headers']['Content-Transfer-Encoding'] == 'base64':
- return base64.b64decode(self.parts['alternatives'][0]['content'])
+ if self.parts and self.parts['alternatives'][0]['headers'].get('Content-Transfer-Encoding', '') == 'base64':
+ return unicode(base64.b64decode(self.parts['alternatives'][0]['content']), 'utf-8')
else:
return self.bdoc.content['raw']