Decoding Internationalised Email Headers |
August 10th, 2010 |
email, python |
Every so often someone will email me something where the subject has
unicode in it. My naive tools don't know what to do with it, and I
see stuff like:
I am continually happily surprised at the fraction of the time that what I want is already implemented in the python standard library.
It turns out python has a module for this, providing email.header.decode_header. This gives me:=?UTF-8?Q?[Sociological_Images]_New_Comment_On:_Satter=E2=80=99s_Hierarch?= =?UTF-8?Q?y_of_Food_Needs?=
So much nicer.[Sociological_Images] New Comment On: Satter's Hierarchy of Food Needs
I am continually happily surprised at the fraction of the time that what I want is already implemented in the python standard library.
←
Should we treat inexpensive diseases first?
Shell History and the Value of Text Only Environments
→
Comment via: facebook