summaryrefslogtreecommitdiff
path: root/service
diff options
context:
space:
mode:
authorJefferson Stachelski <jstachel@thoughtworks.com>2015-10-05 17:36:09 -0300
committerJefferson Stachelski <jstachel@thoughtworks.com>2015-10-05 17:37:49 -0300
commit6c68e0d5d545a98baba99c71cd7eadda76d17f48 (patch)
tree039651f1afc64e27bf7f7075d702e996cba1881d /service
parent48c72644f41967d83e8b58de55ed6764d8bebe7b (diff)
issue #473 - Fixed the encoding problem
Encoding all the strings that are been concatenaded
Diffstat (limited to 'service')
-rw-r--r--service/pixelated/adapter/mailstore/body_parser.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/service/pixelated/adapter/mailstore/body_parser.py b/service/pixelated/adapter/mailstore/body_parser.py
index d8bf3264..249d2a25 100644
--- a/service/pixelated/adapter/mailstore/body_parser.py
+++ b/service/pixelated/adapter/mailstore/body_parser.py
@@ -34,7 +34,10 @@ class BodyParser(object):
def parsed_content(self):
charset = _parse_charset_header(self._content_type)
- text = self._serialize_for_parser(charset)
+ try:
+ text = self._serialize_for_parser(charset)
+ except Exception as error:
+ import ipdb; ipdb.set_trace()
decoded_body = self._parse_and_decode(text)
@@ -55,7 +58,7 @@ class BodyParser(object):
text += 'Content-Transfer-Encoding: %s\n' % self._content_transfer_encoding
text += '\n'
if isinstance(self._content, unicode):
- text += self._content.encode(charset)
+ text = text.encode(charset) + self._content.encode(charset)
else:
text += self._content
return text