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

Thorsten Kampe thorsten at thorstenkampe.de
Wed Feb 25 12:01:08 EST 2009


* Gabriel Genellina (Wed, 25 Feb 2009 14:00:16 -0200)
> En Wed, 25 Feb 2009 13:40:31 -0200, Thorsten Kampe  
> <thorsten at thorstenkampe.de> escribió:
> > * 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.
> 
> And I wonder why you would think the header does *not* contain Unicode  
> characters when it says "us-ascii"?.

Basically because it didn't contain any Unicode characters (anything 
outside the ASCII range).

Thorsten



More information about the Python-list mailing list