Decode email subjects into unicode

Laszlo Nagy gandalf at
Tue Mar 18 10:44:13 CET 2008

Hi All,

'm in trouble with decoding email subjects.  Here are some examples:

> =?koi8-r?B?4tnT1NLP19nQz8zOyc3PIMkgzcHMz9rB1NLB1M7P?=
> [Fwd: re:Flags Of The World, Us States, And Military]
> =?ISO-8859-2?Q?=E9rdekes?=
> =?UTF-8?B?aGliw6Fr?=

I know that "=?UTF-8?B" means UTF-8 + base64 encoding, but I wonder if 
there is a standard method in the "email" package to decode these 
subjects? I do not want to re-invent the weel.



More information about the Python-list mailing list