Summary

  • RFC 2047, November 1996, describes techniques "to allow the encoding of non-ASCII text in various portions of a RFC 822 message header".
  • The design is explicitly defensive: relaying programs are known to delete some header fields, rearrange addresses, reorder fields, and "wrap" headers at different places than the original.
  • So the encoding uses "encoded-words", sequences of ordinary printable ASCII beginning with =? and ending with ?=, and each header line containing one is limited to 76 characters.

The constraint was other people's bugs

Somewhere under the friendly display name in your mail client sits a string like =?UTF-8?B?5L2g5aW9?=. It looks like damage. It is a treaty — signed with software that was already broken when the treaty was written.

Making a header hold Unicode is not hard. Making it survive the software already installed is hard, because that software deletes header fields, rearranges addresses, reorders fields and rewraps lines wherever it likes. Breaking it, the specification noted, "would cause severe operational problems".

So the authors refused the elegant option. They avoided the little-used corners of the header syntax and picked a shape no human would type, so it cannot appear by accident and is hard to damage without anyone noticing.

Encoded words are a treaty, not an encoding

The interesting part is not base64 or quoted-printable. It is the decision that a name written in another script must travel as a token whose meaning is obvious to a parser and invisible to a program that only rewraps lines.

Every encoded word carries its own charset and encoding, so a reader can decode it without guessing — and a broken one is recognisable as broken rather than rendered as noise. Make the payload self-describing and the failure legible, and the format survives a decade of indifferent handling.

The 76-character rule is a parser budget

The line limit exists "both to ease interoperability through internetwork mail gateways, and to impose a limit on the amount of lookahead a header parser must employ".

That is a rare thing: a length limit with a stated reason that has nothing to do with the wire. It bounds how far a parser must read ahead before deciding whether a token is an encoded word or ordinary text. The number is not a style preference. It is a budget for uncertainty.

Splitting is where the bugs live

Long text must be broken into several encoded words, and the reader must join adjacent ones. Anything that inserts a newline, a comment or a fold between them changes the decoded text.

The specification reserves certain characters between encoded words because a space between two of them carries meaning, and because software that rewraps headers will cheerfully insert one. Every decoder bug you have ever met — the stray space, the name cut in half — lives at that seam.

What it cost to keep the old software working

The message a newcomer would design is cleaner. The message this document designed is uglier on the wire and works in the presence of a decade of bugs nobody could fix.

That is the internet's usual trade: syntax is chosen by the deployed base, not by taste, and the interface ends up looking like the history of its predecessors.

Which is the lesson worth carrying out of 1996. Compatibility is not a footnote to design; it is a constraint that shapes every token. Write down what the installed base does badly, because that list is your grammar. When a format has to pass through software you do not control, design for the damage, state which damage you expect, and make corruption visible rather than silent.