The Written Ampersand: When Correct Text Stops Matching Itself
A text can be rendered correctly, read correctly by a person, and still fail to match itself. That is the quiet failure at the centre of this...
A text can be rendered correctly, read correctly by a person, and still fail to match itself. That is the quiet failure at the centre of this test. Records were passed through HTML entity encoding, a routine step in web pipelines, and then compared with their originals as plain strings. The characters a reader would see had not been corrupted. The spelling underneath had changed. A character written as an entity is a different sequence of characters from the character itself, so an exact string comparison treats two presentations of the same text as two different texts. Nothing looks broken, yet joins, deduplication checks, and search indexes that rely on exact equality quietly lose records that were never actually lost.
What The Written Ampersand means
The Written Ampersand means the condition in which a text exists in an entity-encoded spelling, so that its underlying character sequence differs from the plain spelling of the same visible text, and exact matching fails even though rendering succeeds. The name takes the ampersand as its emblem because the ampersand is both a character that gets encoded and the character that begins every entity, so a single encoded character carries the mark of the encoding layer itself.
The measurement is presented on the page as counts of records recovered or matched out of the full test set, stated as fractions rather than as a vendor rate. The full set held 600 texts passed through HTML entity encoding (Source: batch 12 data anchor ledger, section C, AC3). Within that set, 200 texts contained a non-breaking space written as an entity (Source: batch 12 data anchor ledger, section C, AC3). Every result in this article is a count against those denominators, and no result is a claim about any commercial product, because the run was a controlled synthetic test described in the method section below.
The near neighbour is the Mojibake Rate. Mojibake happens at the byte layer, when a character set is read wrongly and the rendered output itself becomes garbled on screen. The Written Ampersand is different. It occurs when the character set is completely correct and nothing is garbled at all. The failure lives at the markup layer, where entity encoding lets the same text exist under another spelling. What breaks is matching, not rendering, and that distinction matters because a team hunting for garbled characters will never find this fault by looking at the screen.
Where Exact Matching Breaks First
The headline result is how little survives encoding untouched. The original text and the encoded text matched exactly in 130 cases out of 600 (Source: batch 12 data anchor ledger, section C, AC3). Stated as a share, that is a minority of the set (derived: 130 ÷ 600). The remaining records were not damaged in any visible way. They were simply spelled differently underneath, with entities standing where single characters had stood before.
That gap has a practical shape. Any pipeline stage that compares, hashes, or keys a table on raw strings will see the encoded form as a new record. A deduplication step will keep both copies. A join against a clean reference table will miss. None of those failures raises an error, because the strings genuinely are different. The lesson is that encoding is a transformation, even when it is lossless for readers. Comparison has to happen after decoding, or on a canonical form both sides share.
What One Decode Repairs, and What It Leaves Behind
Decoding helps a great deal, but it does not finish the job. After the encoded texts were decoded once, the recovered count rose to 400 out of 600 (Source: batch 12 data anchor ledger, section C, AC3). That is a substantial recovery (derived: 400 ÷ 600), and it shows that a single decode pass is the right first repair for entity-encoded text arriving from a web source.
The records left behind share a specific cause. The texts containing a non-breaking space entity still failed after decoding in 200 cases out of 200 (Source: batch 12 data anchor ledger, section C, AC3). Decoding that entity produces the character U+00A0, not an ordinary space (Source: batch 12 data anchor ledger, section C, AC3). A reader sees a space; a comparison sees a different character, so the match still fails. The fix is a normalisation step that treats the two space characters as equivalent for matching, applied deliberately rather than assumed.
Double encoding sharpens the point. When texts had been encoded twice, decoding once recovered 130 out of 600, and decoding twice recovered 400 out of 600 (Source: batch 12 data anchor ledger, section C, AC3). A pipeline therefore needs to know, or detect, how many encoding layers it is unwrapping. Decoding a fixed number of times by habit will under-repair some feeds.
How the encoding test was run
The method was deliberately narrow, and its limits should be stated plainly. This was a synthetic test, run on constructed data rather than on records taken from a live service. The run used seed 42, so the same inputs can be regenerated exactly. The matching, encoding, and decoding were performed by the script's own deterministic logic, written for this test, and the results are not a measurement of any commercial product. No vendor tool was benchmarked, and no score here should be read as the performance of any named cleaning, parsing, or matching product.
Within that frame, a set of texts was encoded with HTML entities, a subset carrying a non-breaking space entity, and the encoded forms were compared with the originals by exact string equality. The encoded forms were then decoded and compared again, and a double-encoded variant was decoded in stages so recovery could be counted after each pass.
Questions, answered
Why does encoded text look fine but fail to match? Because rendering and matching read different things. A browser or preview resolves entities into characters for display, while an exact comparison reads the raw sequence, where an entity and the character it stands for are different sequences. In this test the original and encoded forms matched in only 130 cases out of 600 (Source: batch 12 data anchor ledger, section C, AC3).
Does decoding once fix entity-encoded text? It fixes most of it, not all of it. Decoding once recovered 400 out of 600 texts (Source: batch 12 data anchor ledger, section C, AC3). The remainder needs a further step, because one class of character decodes to something that still differs from the original, as the next answer explains.
Why do non-breaking spaces survive decoding as a mismatch? Because the entity decodes to U+00A0 rather than to an ordinary space (Source: batch 12 data anchor ledger, section C, AC3). Every text carrying that entity still failed after decoding, 200 out of 200 (Source: batch 12 data anchor ledger, section C, AC3). Matching needs a normalisation rule that equates the two space characters.
What happens when text has been encoded twice? Each decode pass removes one layer. With double-encoded text, decoding once recovered 130 out of 600 and decoding twice recovered 400 out of 600 (Source: batch 12 data anchor ledger, section C, AC3). The recovery at each depth matches the single-encoding pattern, so the repair has to match the number of layers actually present.
Is this the same problem as mojibake? No. Mojibake is a byte-layer failure that garbles what a reader sees. The Written Ampersand happens with the character set completely correct and the display completely clean. The fault is at the markup layer, and what it breaks is matching rather than rendering, which is why visual inspection alone will not find it.
Summary
The Written Ampersand is a spelling problem disguised as no problem at all. Entity encoding left exact matching at 130 out of 600, a single decode raised recovery to 400 out of 600, and the non-breaking space cases resisted decoding entirely at 200 out of 200, because they decode to U+00A0 instead of a space (Source: batch 12 data anchor ledger, section C, AC3). Double encoding repeated the same pattern layer by layer. The operational rule is plain: decode before comparing, normalise the space characters that decoding leaves behind, and never trust a clean preview as evidence that two texts will match.
Sources
- Batch 12 data anchor ledger, section C, test group AC3: HTML entity encoding run over the synthetic text set, including the non-breaking space subset and the double-encoding stage, read 2026-11-23.
- All figures in this article are counts from that run, reported as fractions of the stated set, with derived shares labelled where they appear.