[Baypiggies] charsets in email headers
brent.tubbs at gmail.com
Mon Aug 25 23:52:28 CEST 2008
Thank you for the link, Jason. I'd been staring at that page (as
well as http://docs.python.org/lib/module-email.charset.html) for a
while before emailing the group, but it's over my head and there is no
example for converting from one charset to another. An example from
someone who's done it would be most welcome.
On Mon, Aug 25, 2008 at 2:20 PM, Jason Culverhouse
<jason at mischievous.org> wrote:
> Right here...
> from email.header import decode_header
> [('[Invitation] dummy event 4 @ Tue Aug 26 10pm \x96 11:', 'windows-1252')]
> On Aug 25, 2008, at 1:46 PM, Brent Tubbs wrote:
>> I'm writing a Google App Engine app that accepts incoming emails using
>> the free smtp2web.com service. Things are generally working, but some
>> (not all) subject lines in the emails look like this (this one's a
>> Google Calendar event invitation):
>> I've learned that that's got something to do with the subject being in
>> the windows-1252 charset, but I'm mystified as to how to turn that
>> into human-readable ASCII. The python email module has a charset
>> class that's supposed to help with this I think, but I don't know how
>> to make it do what I need.
>> Any suggestions on the best way to turn the ugly string above into
>> something nicer?
>> Baypiggies mailing list
>> Baypiggies at python.org
>> To change your subscription options or unsubscribe:
More information about the Baypiggies