Encoding Accented Characters in E-mail Subjects
To send an e-mail where the subject contains accented characters, encode the string like so:
Bonne id?e
...becomes...
=?iso-8859-1?q?Bonne id=E9e?=
The string starts with =?iso-8859-1?q?
and ends with ?=
. Then every character to be encoded starts with the =
and the hex value for that character.
I don't recall ever having run into this problem before but this solution works. If you know of another way to send accented characters in a subject line, let me know.
Conversation
This technique works for other headers too (e.g. From) and is not limited to any particular character set. For example, try this:
m=?UTF-8?B?w6ljaGFudCDimaUgY8WTdXI=?=
which should render as:
méchant ♥ cœur
Check out RFCs 1342 and 2047.