From 6c68e0d5d545a98baba99c71cd7eadda76d17f48 Mon Sep 17 00:00:00 2001 From: Jefferson Stachelski Date: Mon, 5 Oct 2015 17:36:09 -0300 Subject: issue #473 - Fixed the encoding problem Encoding all the strings that are been concatenaded --- service/pixelated/adapter/mailstore/body_parser.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'service/pixelated/adapter/mailstore/body_parser.py') 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 -- cgit v1.2.3