[issue18271] get_payload method returns bytes which cannot be decoded using the message's charset

2013-06-20 Thread Marko Lalic
New submission from Marko Lalic: When the message's Content-Transfer-Encoding is set to 8bit, the get_payload(decode=True) method returns the payload encoded using raw-unicode-escape. This means that it is impossible to decode the returned bytes using the content charset obtained b

[issue18271] get_payload method returns bytes which cannot be decoded using the message's charset

2013-06-20 Thread Marko Lalic
Marko Lalic added the comment: That will work fine as long as the characters are actually latin. We cannot forget the rest of the unicode character planes. Consider:: >>> message = message_from_string("""MIME-Version: 1.0 ... Content-Type: text/plain; charset=utf-8

[issue18271] get_payload method returns bytes which cannot be decoded using the message's charset

2013-06-20 Thread Marko Lalic
Marko Lalic added the comment: Thank you for your reply. Unfortunately, I have a use case where message_from_bytes has a pretty great disadvantage. I have to parse the received message and then forward it completely unchanged, apart from possibly adding a few new headers. The problem with