• Posts
  • RSS
  • ◂◂RSS
  • Contact

  • Decoding Internationalised Email Headers

    August 10th, 2010
    email, python  [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:

    Quick Note: PPP Adjustments

    All construction cost figures that I sign my name to adjust currencies for purchasing power parity, or PPP. In other words, I convert currencies across countries in PPP terms, not exchange rate terms. This is not how everyone else does this; the World Ban…

    via Pedestrian Observations July 21, 2021

    Songs about terrible relationships

    [Spoilers for several old musicals.] TV Tropes lists dozens of examples of the “I want” song (where the hero of a musical sings about their dream of escaping their small surroundings). After watching a bunch of musicals on maternity leave, I’m wondering h…

    via The whole sky July 17, 2021

    Collections: The Queen’s Latin or Who Were the Romans? Part III: Bigotry and Diversity at Rome

    This is the third part (I, II) of a series asking the question “Who were the Romans?’ How did they understand themselves as a people and the idea of ‘Roman’ as an identity? Was this a homogeneous, ethnically defined group, as some versions of pop folk his…

    via A Collection of Unmitigated Pedantry July 16, 2021

    more     (via openring)


  • Posts
  • RSS
  • ◂◂RSS
  • Contact