← All posts

From teleprinter to UTF-8: the 150-year chain of character transmission

From teleprinter to UTF-8: the 150-year chain of character transmission

Here is a question I do not think enough people have asked: what happens between the moment you press a key and the moment the letter lands on somebody else's screen? Not in software terms — in wire terms. There is a pulse. A current. A physical something that leaves your machine, crosses a wire, crosses a country, and gets turned back into a letter. For most of human history that something was a mechanical hammer.

This is character transmission history, told by someone who has personally broken a link between two machines and personally fixed it, usually by accident. The teleprinter to UTF-8 arc is one continuous argument about how to squeeze a language into a wire, and it has been running for a hundred and fifty years.

1874: a wire, a current, and one very opinionated clock

Picture a telegraph key. You press it, the circuit closes, and somewhere down the line a sounder starts clicking. Two states: current or no current. One bit, if you want to be modern about it. That is the entire alphabet at first — mark and space, or on and off.

But "on" and "off" tell the receiver nothing about when a letter starts, so the machines added a clock: a pulse arrives meaning "new character, get ready," and between those pulses the data bits spell the word. A metronome saying ready... and... go, while the melody between the beats carries the message.

Now the hard part. Five bits gives 32 possible patterns. Thirty-two letters, uppercase only. No lowercase. No punctuation worth speaking of. So how do you send an exclamation mark? You can only stare at those 32 slots. The obvious fix — steal a few for punctuation — breaks everything, because then how do you type the letter you just stole? This is the oldest problem in character encoding evolution and it never goes away: every time you want a new symbol, you steal a slot from something you already need.

The answer that held for decades was elegant and awful: shift. The machine had a lever — LTRS or FIGS — that said "everything means the other thing now." Type FIGS and 2 became a quote mark; type LTRS and it came back as a plain 2. ITA2 — International Telegraph Alphabet No. 2 — was the code that did this, and every teleprinter on earth spoke it. Teleprinter history in one gesture: a mechanical lever that swapped the meaning of the alphabet mid-sentence.

The tape that became a byte

Operators working a live line were a bottleneck, so the industry moved to paper tape. The machine punched holes in a roll of paper, and the tape became a buffer you could queue, replay, store, and later feed into a machine that read it.

And this is the moment character transmission history stops being about telegraphy and starts being about computing. Picture five rows of possible holes running down the length of that paper. Each row is one bit, so five rows, so five bits, so one column per letter. A hole-punched tape is a byte. The teleprinter became a printer, the printer a terminal, the tape a program.

So when you hear that the "first computer bug" was a moth taped into a relay, understand: the moth was the last physical cousin of a hole in a paper roll. The idea that a character is a fixed-width row of bits — a letter is a coordinate, an address into a table — comes straight off the tape. That is where the teleprinter to UTF8 arc turns: the letter stopped being a sound and became a coordinate.

1963: the committee finally counts

Five bits is not enough for the world that was about to exist. Lowercase. Punctuation. Digits and letters and symbols, all at once, without a mode switch. And national alphabets, because the accents will not fit.

The Americans solved this first. ASA X3.4, published in 1963 — seven bits, 128 slots — later renamed ASCII. Seven bits because teleprinter circuits happily carried eight, but the committee chose seven and reserved the eighth for a parity bit. Parity, as far as I remember, was a checksum before checksums were cool: one extra bit, so the receiver could notice if static flipped one of your letters.

ASCII is a good design and I will defend it. The first 32 slots are control characters — the invisible plumbing — and the printable stuff sits from space (32) through tilde (126). It is ordered: uppercase A through Z are 65 through 90, lowercase a through z are 97 through 122. Sort the bytes and you sort the alphabet for free, which is why so much software still assumes it.

But ASCII is a small country. 128 slots, and the moment you want an accent, a currency sign, a box-drawing character, or a CJK ideograph, you are out of room.

The squeeze: 256 slots and a hundred national dialects

Here is the great irony of ASCII. It was born as an international standard — a committee effort, deliberately designed so everyone could type to everyone — and within a decade it had become a set of private dialects.

Europe solved the squeeze the ugliest way possible: grab the eighth bit too, make 256 slots, then fill the top 128 with whatever your language needed. Codepage 437 for the original IBM PC: line-drawing characters in the upper half, so DOS boxes could draw frames. Codepage 850 for European languages. A Russian codepage where the upper half was Cyrillic. A Japanese codepage where the upper half was katakana and half-width graphic tiles — which still makes me laugh.

That top half of CP437 is why we draw ASCII art with characters like │ ─ ┌ ┐ instead of | - +. Those aren't ASCII. They're CP437 smuggled in — and someone else is going to have a bad time converting it. This is exactly the kind of mess the teleprinter to UTF-8 journey was born to end.

The language question got a partial answer with the ISO 8859 series: fifteen or sixteen 8-bit standards, one per European language, each being "the same as Latin-1 except for these fifteen characters." Latin-1 won, mostly. Then Latin-9 — Latin-1 with a few characters swapped out, a painful decision that broke older documents forever.

And then the Asian elephant. CJK doesn't fit in 256. Not close. Shift JIS, EUC-JP, Big5, GB2312, GBK, GB18030 — an alphabet soup of multi-byte encodings, each with its own idea of how a Chinese character becomes bytes, and famously incompatible with each other. Two Japanese computers on one network could disagree about a single character.

1991: the room where Unicode happened

Here is the part almost nobody knows. For most of the twentieth century, character encoding evolution is committees failing to agree. Unicode's origin is different.

In the late 1980s the world's software was still exploding from the encodings mess — every new machine bringing its own 256-slot dialect. So people started building global workstations that had to read everything. And two guys at Xerox PARC, Joseph Becker and Mark Davis, had the idea of a single table containing every character used by every human language, each assigned a fixed number — a code point.

The founding meeting of the Unicode consortium was held at Xerox PARC in 1991, the lab that gave us the Alto, the graphical interface, and the mouse, with representatives from Apple, Microsoft, and IBM sent along. I love this because the industry was still small enough that one table could be settled in a room. Every character got a 16-bit code point, room for about 65,000 of them. The name "Unicode" was a play on "UCS," the Universal Character Set.

Two bytes per character is the whole bet, and UTF-16 still lives inside it: BMP characters are two bytes, astral-plane characters — emoji, rare CJK, historic scripts — are surrogate pairs, four bytes. But two bytes per character costs you on the wire: a little A becomes 00 41, obscene for the text we send most of the time. So we needed a second standard — one that used a single byte for ASCII and expanded only when necessary.

1992: Ken, Rob, and a phonebook of characters

The design that won is UTF-8, and the story as far as I remember it goes like this: Ken Thompson and Rob Pike were at Bell Labs working on Plan 9, and they needed an encoding that could carry any Unicode character and keep ASCII text looking exactly like ASCII text.

Thompson's trick is one of the most elegant ideas in the history of computing. A UTF-8 byte's leading bits tell you how long the character is and where to continue: a leading 0 means a single-byte ASCII character; 110 means two bytes; 1110 means three; 11110 means four. Every byte after the first starts with 10, which is how the receiver knows to keep reading instead of starting a new character.

The payoff: a byte under 0x80 is just plain ASCII, so every ASCII byte in a UTF-8 file is byte-identical to the ASCII byte it replaces. A UTF-8 file containing only English text is, byte for byte, an ASCII file. The reason UTF-8 stuck is the exact reason it was designed: it degrades gracefully. A truncated character at the end of a stream doesn't corrupt the characters before it. Compare that to Shift JIS, where a single byte mid-string can be half a character. That is why the teleprinter to UTF-8 story ends with UTF-8 and not with something cleverer.

The final piece came in 1993 and 1998, when the IETF standardized UTF-8 as RFC 2279 and then RFC 3629. The web took it: the Linux kernel, Windows, every browser, every database, every language runtime. A committee-made table from a Xerox PARC meeting, filtered through an idea two Bell Labs engineers had while making an operating system nobody commercially adopted.

From teleprinter to UTF-8: the chain, if you follow it

In 1874 Baudot's telegraph code put five bits on one wire with a shift lever to steal slots. In the 1900s through the 40s, paper tape turned characters into fixed-width rows of holes — the first bytes. From 1924 on, teleprinters automated the punch and ITA2 became the lingua franca for typed words. In 1963 ASCII arrived with seven bits, 128 slots, and a parity bit watching the line. In the 1980s the eighth bit got grabbed, codepages proliferated, and the "international" standard became 256 private dialects. From 1987 to 1991 ISO 8859 tried to fix Europe with fifteen variants while Unicode was conceived at Xerox PARC. And from 1992 to 1998 UTF-8 came out of Bell Labs, standardized as RFC 2279 then 3629, and the world adopted it.

The thing that made UTF-8 stick wasn't power. It was backwards compatibility with the oldest thing in the chain. ASCII bytes survive. The teleprinter's descendants didn't get overthrown; they got extended. That is the moral of character transmission history: the winners are the standards that refuse to make the old thing wrong.

Where the chain ends (probably)

Here is the part that keeps me up. UTF-8 solved the encoding problem beautifully. It did not solve the normalization problem.

There are multiple ways to encode the same visible character. é can be one code point, precomposed, or two — e followed by a combining accent. The two look identical to a human and are completely different strings to a byte-comparing diff. The Unicode standard has normalization forms — NFC and NFD and friends — to reconcile this, and you have to pick one and hope the other guy does too.

That's the punchline of the whole 150-year story, and I love it. We spent a century fighting over how to fit characters into a wire. Now we fit them into a wire beautifully, and we fight about which of two byte sequences that render identically should be the real one. The teleprinter clerks would have found that hilarious — they never had a choice, because the lever was down, so 2 was 2. Now we have seventeen ways to say é and every one of them is "correct."

The next link in character transmission history probably won't be a table of characters at all. It'll be a table of normalization rules — a sadder and more necessary kind of document.

If you want to see this history as a picture instead of a paragraph, the ascii.im studio turns any text you feed it into a text-mode picture. The text pixel art guide covers the visual basics, and there's a pricing page if the free tier isn't enough.

So here's my question for you, and I'll leave it there. In fifty years, will we be arguing about Unicode normal forms — or will we have quietly invented some new scheme that solves a problem we currently don't even know we have? Because that's the pattern: every generation of this chain inherits a solved problem and immediately creates a worse one.

I'm betting we haven't solved it yet. And I bet somebody, right now, is looking at a table of characters and wondering what the problem is that comes next.

From teleprinter to UTF-8: the 150-year chain of character transmission — ascii.im Blog