How do I decode unicode characters in the subject using email.message_from_string()?

Thorsten Kampe thorsten at thorstenkampe.de
Wed Feb 25 10:40:31 EST 2009


* Roy H. Han (Wed, 25 Feb 2009 10:17:22 -0500)
> Thanks, RDM, for stating the right approach.
> Thanks, Steve, for teaching by example.
> 
> I wonder why the email.message_from_string() method doesn't call
> email.header.decode_header() automatically.

And I wonder why you would think the header contains Unicode characters 
when it says "us-ascii" ("=?us-ascii?Q?"). I think there is a tendency 
to label everything "Unicode" someone does not understand.

Thorsten



More information about the Python-list mailing list