[Email-SIG] encoding To headers

Wichert Akkerman wichert at wiggy.net
Fri Dec 3 16:13:21 CET 2004


I am trying to figure out how to use an 'internationaled' To-header but
not succeeding so far. The basic documented approach does not work:

>>> mail["From"]=email.Header.Header(, "utf-8")
>>> print mail.as_string()
[...]
From: =?utf-8?b?dMODwrhzdGk=?=

this is not allowed by the RFCs: the address must not be encoded. Using
quoted-printable would fix this but I can not find any documentation
as to how to do that.

All current documentation mentions that specifying encoders is
deprecated, but without setting them the email module seems to insist on
using base64 encoding.

Wichert.

-- 
Wichert Akkerman <wichert at wiggy.net>    It is simple to make things.
http://www.wiggy.net/                   It is hard to make things simple.


More information about the Email-SIG mailing list