::  Posts  ::  RSS  ::  ◂◂RSS  ::  Contact

Decoding Internationalised Email Headers

August 10th, 2010
python, email  [html]
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:
=?UTF-8?Q?[Sociological_Images]_New_Comment_On:_Satter=E2=80=99s_Hierarch?=  =?UTF-8?Q?y_of_Food_Needs?=
It turns out python has a module for this, providing email.header.decode_header. This gives me:
[Sociological_Images] New Comment On: Satter's Hierarchy of Food Needs
So much nicer.

I am continually happily surprised at the fraction of the time that what I want is already implemented in the python standard library.

Comment via: facebook

Recent posts on blogs I like:

What Does Private Affluence, Public Squalor Mean?

I’d like to compare three cities: Paris, New York, Boston. They’re about equally wealthy, and I’ve lived years in two and spent a lot of time in the third. Americans dismiss New York and Boston too often as Not Real America, but they’re both excellent exa…

via Pedestrian Observations November 19, 2019

Pieces of time

My friend used to have two ‘days’ each day, with a nap between—in the afternoon, he would get up and plan his day with optimism, whatever happened a few hours before washed away. Another friend recently suggested to me thinking … Continue reading →

via Meteuphoric November 11, 2019

Wild animal welfare in Hans Christian Andersen

Continuing the theme of wild animal suffering in children’s lit… Hans Christian Andersen’s stories involve a lot of suffering of both human and animal varieties. “The Ugly Duckling” takes a brief detour from describing the duckling’s repeated social humil…

via The whole sky November 7, 2019

more     (via openring)

More Posts:


  ::  Posts  ::  RSS  ::  ◂◂RSS  ::  Contact