From aaed875ecce770bde03a2066ade40944cd1ab31d Mon Sep 17 00:00:00 2001 From: NavaL Date: Fri, 21 Oct 2016 21:11:22 +0200 Subject: [#797] reinstating use of the provided email body charstet encoding --- service/pixelated/adapter/mailstore/body_parser.py | 5 +++-- 1 file changed, 3 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 5408bd9d..8cac75cf 100644 --- a/service/pixelated/adapter/mailstore/body_parser.py +++ b/service/pixelated/adapter/mailstore/body_parser.py @@ -31,13 +31,14 @@ def _parse_charset_header(content_type_and_charset_header, default_charset='us-a class BodyParser(object): - def __init__(self, content, content_type='text/plain; charset="us-ascii"', content_transfer_encoding=None): + def __init__(self, content, content_type='text/plain; charset="us-ascii"', content_transfer_encoding=None, charset=None): self._content = content self._content_type = content_type self._content_transfer_encoding = content_transfer_encoding + self._charset = charset def parsed_content(self): - charset = _parse_charset_header(self._content_type) + charset = self._charset or _parse_charset_header(self._content_type) text = self._serialize_for_parser(charset) decoded_body = self._parse_and_decode(text) -- cgit v1.2.3