• Posts
  • RSS
  • ◂◂RSS
  • Contact

  • 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:
    =?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:

    How much to coerce children?

    What's "for their own good"? The post How much to coerce children? appeared first on Otherwise.

    via Otherwise May 29, 2023

    Cycling Injuries Analysis in DC

    I looked at a few years’ worth of data for DC (where I live) to try to figure out how risky cycling is here.

    via Home May 19, 2023

    Some mistakes I made as a new manager

    the trough of zero dopamine • managing the wrong amount • procrastinating on hard questions • indefinitely deferring maintenance • angsting instead of asking

    via benkuhn.net April 23, 2023

    more     (via openring)


  • Posts
  • RSS
  • ◂◂RSS
  • Contact