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

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Wed Feb 25 18:36:22 CET 2009


En Wed, 25 Feb 2009 15:01:08 -0200, Thorsten Kampe  
<thorsten at thorstenkampe.de> escribió:
> * 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).

I think you have to revise your definition of "Unicode".

-- 
Gabriel Genellina




More information about the Python-list mailing list