Advertisement
Data Processing

The Zero-Width Identifier: The Character Nobody Can See Breaks the Match

An email address is an identifier that humans read at a glance. If two copies of the same address look identical on screen, a person will say they ar...

An email address is an identifier that humans read at a glance. If two copies of the same address look identical on screen, a person will say they are the same address, and in every ordinary sense they are right. A computer performing an exact string join does not look at the screen. It compares code point by code point, and it will separate two addresses that a person cannot tell apart if one of them carries an extra character that renders with no width at all. The measurement in this article inserts exactly one such invisible character into most of a set of email addresses and counts what happens to an exact join. Four out of five addresses fail to match their own clean copies. Deleting the invisible characters then restores every single match, without merging anything that should stay apart. The fault is not in the addresses, and not in the join. It is in the assumption that looking the same means being the same string.

What The Zero-Width Identifier means

The Zero-Width Identifier is an identifier that carries one or more zero-width code points, characters that occupy a position in the string but no space on the screen, so that the identifier is visually identical to its clean form while being a different string under exact comparison. In the measurement, a registry of 300 clean email addresses was paired with a second source holding the same 300 addresses, of which 240 had one zero-width code point inserted inside the local part, rotating through U+200B, U+200C, U+200D, and U+FEFF, while 60 were left clean as controls (Source: batch 16 SD measurement results, group AG1). The rule under test is exact string joining on the email address as stored.

Sample: 300 email addresses; 240 with one zero-width code point inserted in the local part; exact join matched 60 of 300 and failed 240, or 80.0 percent (Source: batch 16 SD measurement results, group AG1)

After deleting the four zero-width code points: 300 of 300 matched, with 0 false merges (Source: batch 16 SD measurement results, group AG1)

The Zero-Width Identifier differs from its nearest neighbour, The Encoded Twin, in visibility and in mechanism. In The Encoded Twin, one value existed in an original form and in a percent-encoded transport form, where the at sign became the three visible characters %40 and a space became %20; the two forms looked different, a reader could see that something had happened to the value, and the repair was decoding, which itself carried a risk, because decoding values whose percent sequences were literal data falsely merged every counterexample pair in that measurement. Here nothing visible happens at all. The altered address contains a character with no printed width, so the two forms are indistinguishable to any human reviewer, screenshot, or printed report. The difference is carried entirely below the level of sight, in the code points themselves. And the repair differs in its risk profile within this measurement: removing the four named zero-width code points restored all 300 matches with 0 false merges (Source: batch 16 SD measurement results, group AG1), because a zero-width code point inside an email local part is not carrying identity information that a legitimate address needs.

Four out of five addresses fail to match themselves

The exact join matched only the clean minority. Of the 300 addresses, 60 matched and 240 failed, a failure share of 80.0 percent (Source: batch 16 SD measurement results, group AG1). The 60 matches are exactly the 60 control addresses that received no insertion (Source: batch 16 SD measurement results, group AG1), which confirms the mechanism with unusual cleanliness: every address that received one invisible character failed, and every address that did not receive one passed. There is no partial damage and no noise in the result. One code point, of zero width, is sufficient to sever an identifier from itself.

The Zero-Width Identifier: The Character Nobody Can See Breaks the Match

Deleting four code points restores everything, and merges nothing

The repair tested was deliberately narrow: delete exactly the four zero-width code points used in the construction, U+200B, U+200C, U+200D, and U+FEFF, from the stored strings, and then repeat the exact join (Source: batch 16 SD measurement results, group AG1). After that deletion, the join matched 300 of 300 addresses, and the number of false merges, cases where two genuinely different addresses collapsed into one key, was 0 (Source: batch 16 SD measurement results, group AG1). The narrowness is the point. The rule does not rewrite the address, translate it, or guess at its intended form; it removes only characters that have no legitimate role in this identifier and no visible presence, and the full recovery with no collateral merging is the evidence that, for this identifier family, those characters were pure contamination.

How the invisible insertions were built and tested

This section describes the measurement method, as every article in this series does for its synthetic evidence. The data was produced by a deterministic synthetic measurement script, run with seed 42, on synthetic data constructed for this test; it is not a measurement of any commercial product, and it rates no vendor. The script built 300 clean email addresses for a registry, then built a second source containing the same 300 addresses, inserting one zero-width code point, rotating through U+200B, U+200C, U+200D, and U+FEFF, into the local part of 240 of them and leaving 60 clean as controls (Source: batch 16 SD measurement results, group AG1). It then performed an exact string join between the two sources and counted matches and failures, deleted the four zero-width code points from the stored strings, and repeated the join while counting false merges. The fixed seed makes the construction reproducible, and the clean controls make the before-and-after comparison attributable to the insertions alone rather than to any other difference between the sources.

Questions, answered

How many addresses failed the exact join, and why did the rest pass?

240 of the 300 addresses failed, which is 80.0 percent, and 60 matched (Source: batch 16 SD measurement results, group AG1). The 60 that passed were the clean controls that received no insertion; every address that received one zero-width code point failed, because exact comparison treats a string with an extra code point as a different string, however it renders.

Which characters caused the failure?

Four zero-width code points, used in rotation: U+200B, U+200C, U+200D, and U+FEFF, each inserted once, inside the local part of an address (Source: batch 16 SD measurement results, group AG1). None of them prints with any width, which is why visual inspection of the failed pairs shows two apparently identical addresses.

Did cleaning the addresses merge any different addresses together?

No. After deleting the four zero-width code points, the join matched 300 of 300 addresses with 0 false merges (Source: batch 16 SD measurement results, group AG1). In this measurement the deleted characters carried no distinguishing information, so removing them recovered every intended match and created no unintended ones.

Summary

The Zero-Width Identifier is an address that looks exactly like itself and is not itself, because an invisible code point has taken up residence inside it. In the measurement, 240 of 300 addresses carried one such character and all 240 failed an exact join, a failure share of 80.0 percent, while the 60 clean controls all matched (Source: batch 16 SD measurement results, group AG1). Deleting the four zero-width code points, U+200B, U+200C, U+200D, and U+FEFF, restored the join to 300 of 300 with 0 false merges (Source: batch 16 SD measurement results, group AG1). When two identifiers look identical and refuse to match, stop looking at them. Count their code points instead.

Sources

Know someone who needs this? Share it.

Advertisement