How do I send a message where a character with an accent is in the subject?

Christopher Koenigsberg

Email headers can only contain 7-bit US ASCII characters, according to the Internet standards (mainly RFC 2822, also 2821). For any characters outside that charset, they have to be encoded first. Your (sender's) email client should display the proper characters (accented etc.) to you when you are composing the message, but needs to encode them for transmission. The recipient's email client needs to decode them, for display at the other end.

See RFC 2047 for details about encoding characters in email headers.

Here are some classic examples, from RFC 2047, of some encoded text in email headers:

From: =?ISO-8859-1?Q?Olle_J=E4rnefors?= <ojarnef@admin.kth.se>

From: Nathaniel Borenstein <nsb@thumper.bellcore.com> (=?iso-8859-8?b?7eXs+SDv4SDp7Oj08A==?=)

The first example is of some iso-8859-1 characters, encoded using the "Q" encoding (same as "quoted-printable" content-transfer-encoding for body parts). The second example is some iso-8859-8 characters, using the "B" encoding (same as "base64" content-transfer-encoding for body parts).

Unlike body parts which need a separate header to tell how they are encoded, in the headers like these, as you see, the start of the escape sequence tells what encoding scheme is used, and what character set has been encoded in it.