[Email-SIG] encoding To headers

Stuart Bishop stuart at stuartbishop.net
Wed Jan 5 11:55:12 CET 2005


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Wichert Akkerman wrote:
| It's been a month since I posted this; can I safely assume nobody knows
| the answer or is it just not possible?

I never saw your original message sorry.

There is code that will correctly encode and decode email addresses at
http://stuartbishop.net/Software/EmailAddress. It handles the case you
mention, as well as handling Unicode domain names if you should ever
actually see one.

|>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.


- --
Stuart Bishop <stuart at stuartbishop.net>
http://www.stuartbishop.net/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)

iD8DBQFB28eQAfqZj7rGN0oRAmg3AJ90ZLjurHATcW2qaGDk/eU6AALvpACgi7tr
gUOlaVn/ArH40aj/YKJhS4k=
=Soir
-----END PGP SIGNATURE-----


More information about the Email-SIG mailing list