Dan Polansky wrote:
When parsing messages using python's libraries email and mailbox, the
subject is often encoded using some kind of = notation. Apparently, the
encoding used in this notation is specified like =?iso-8859-2?Q?=... or
=?iso-8859-2?B?=. Is there a python library function to decode such a
subject, returning a unicode string? The use would be like

human_readable = cool_library.decode_equals(message['Subject'])


    parts = email.Header.decode_header(header)
    new_header = email.Header.make_header(parts)
    human_readable = unicode(new_header)



--

hilsen/regards Max M, Denmark

http://www.mxm.dk/
IT's Mad Science
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to