R. David Murray <rdmur...@bitdance.com> added the comment: Well, that's a bunch of code, and I'm afraid I don't know what your answer to my question was. What error do you get now if you use the new version of mailbox3.patch?
If you feed the new mailbox/email bytes, it will preserve the bytes as is, as long as you don't try to convert the invalid headers to strings. If you convert them to string (by accessing them through the Message object), it will encode them as 'unknown-8bit' using quopri or base64 as appropriate (ie: depending on how many non-ascii chars there are). If you want instead to guess that they are latin-1, you can call decode_header on the stringified version to get back the original bytes, and then substitute your preferred guessed charset for the 'unknown-8bit' charset and go from there to unicode. (For Python3.3 I plan to provide tools to make this kind of processing much simpler.) ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue9124> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com