Guide Cybersecurity 6 min read

Invisible characters in copied text and what they break

Invisible characters such as the zero width space and the direction controls travel inside copied text without showing on screen. We pasted 15 of them into sample Chinese and English names and tested what each did to search, screen order and filenames.

Kenji Tanaka
Developer Tools & Cloud Analyst
Published 23 Nov 2026, 8:16 PM (SGT)
Share:
Close-up of the round keys of an old black typewriter in low light.
Photo by DΛVΞ GΛRCIΛ on Pexels
Advertisement

Invisible characters are Unicode code points that software normally draws as nothing, such as the zero width space, the joiners and the marks that set the direction of text. They ride along in copied text, and the computer still counts them. On 22 November 2026 we put 15 of them, one at a time, into two names we made up, 新加坡贸易公司 (Xīnjiāpō Màoyì Gōngsī, Singapore trading company) and Example Trading Pte Ltd. For 14 of the 15 the screen looked the same. Each added 2–4 bytes to the file. A JavaScript check and two grep programs failed to find 贸易 (màoyì, trade) or Trading every time, while Chromium's find-in-page matched the word in 14 cases.

Unicode lists 4,174 code points as default-ignorable

Unicode's name for the set is Default_Ignorable_Code_Point. The DerivedCoreProperties.txt file for version 18.0.0, dated 7 August 2026, builds it from format characters, variation selectors and a hand-kept list of other characters, which is how a Hangul letter gets onto it, minus white space and a few exceptions, and gives its total as 4,174.

Most of those code points are held in reserve. Unicode Standard Annex (UAX) #44 says new characters "that should be ignored in rendering (unless explicitly supported) will be assigned in these ranges". By our count, 405 are assigned today. The 260 variation selectors and 96 tag characters among them usually have a job, choosing the shape of an emoji or a Chinese character, or spelling out a flag, which leaves 49. The file warns that "there are currently no stability guarantees" for the property, though we found the same 4,174 in the 17.0 and 18.0 files.

Grep and scripts missed the word in every test

Our 15 test characters all came from those 49, among them the language tag U+E0001, which is not one of the 96 tag characters above, and HANGUL FILLER U+3164. We ran the searches on macOS with Node 26.13 (ICU 79.1, the International Components for Unicode library, with Unicode 18.0 data) and Chrome for Testing 149.

Search methodFound the word, of 15
JavaScript includes()0
ugrep 7.8.40
BSD grep (macOS)0
Chromium find-in-page14
ICU collator, Chinese and English rules14

Both lenient methods tripped only on the Hangul filler. Unicode's core specification, chapter 5, says whether a character "should be ignored for searching, string matching, and sorting can depend on the language and application". So an office manager can press Ctrl+F in Chrome and find a supplier's name in a pasted list that a script searching the same text reports as missing. NFKC (Normalization Form KC) normalisation removed none of the 15; it swapped the Hangul filler for another filler, U+1160.

Some blanks on the list take up room

A default-ignorable character can still draw something. In Chromium's default sans-serif at 20 pixels on macOS, U+3164 drew a blank 16.92 pixels wide and its halfwidth form U+FFA0 drew 10, though both are on Unicode's list. NARROW NO-BREAK SPACE U+202F, which is not, took only 2.80 pixels, and Find did not see through it. These widths come from one font on one platform and will differ on others.

Removing them from a list you can read

On 23 November 2026 we ran the Chinese text cleaner, which works from Unicode 18.0.0's own lists, on default settings. All 49 characters, placed between Chinese characters and again inside an English word, were removed and named by code point, and so were all 12 direction controls. In our Thai, Khmer and Myanmar samples it kept the zero width space and flagged it, and likewise the non-joiner in Tamil and Persian. U+202F is listed as a special space and left alone.

To see what a paste holds without changing it, the Unicode confusables checker lists each character by name.

Advertisement

Direction controls change the order you see

Twelve of the 49 steer the Unicode Bidirectional Algorithm, UAX #9 (revision 52, 1 September 2026). Of the overrides it says "They are to be avoided wherever possible, because of security concerns." The four isolates, U+2066 to U+2069, are the newer design, and characters inside one "cannot affect the ordering of characters outside it, or vice versa."

Inside the isolate is another matter. We built these lines, naming each control where it sits, and read the order Chromium drew.

Stored textShown on screen
Total, right-to-left override, 100 SGD, pop, dueTotal DGS 001 due
Total, right-to-left isolate, 100 SGD, pop, dueTotal SGD 100 due
总额 (zǒng'é, total), right-to-left isolate, 100 SGD, pop总额SGD 100
ab, any isolate, cd, pop, efabcdef

The override reverses every character, digits included. The isolate is quieter, turning a stored 100 SGD into SGD 100 on an invoice line. With only letters inside it, the order did not visibly change, which is why a quick test makes isolates look harmless.

The same reordering in source code is the Trojan Source attack, recorded as CVE-2021-42574; the National Vulnerability Database (NVD) record says it "permits the visual reordering of characters via control sequences". Our guide to lookalike domains explains how it differs from a lookalike name.

Filenames that differ by a character nobody sees

On an APFS (Apple File System) drive we saved seven text files. Four were named 报告.txt (bàogào, report), one plain and three with a zero width space, a word joiner or a left-to-right isolate between the two characters. Three were named report.txt, plain or carrying a zero width space or a soft hyphen. All seven sit side by side. Read by a script, or listed by ls with its output piped to another program, they come out as what reads as four copies of one name and three of another; typed in the macOS Terminal, ls printed a question mark where each hidden character sits. In UTF-8 the plain Chinese filename is 10 bytes long and the one with the zero width space 13. APFS ignores differences in normalisation but keeps these characters. We tested no other file system, and did not check Finder.

MITRE's ATT&CK entry T1036.002 (last modified 12 May 2026) says adversaries "may abuse the right-to-left override (RTLO or RLO) character (U+202E) to disguise a string and/or file name".

Thai, Khmer and Myanmar text uses the zero width space

Deleting every invisible character is the wrong reflex for much of Southeast Asia. Unicode's core specification, chapter 23, says zero width spaces "are intended to be used in languages that have no visible word spacing to represent word break or line break opportunities, such as Thai, Myanmar, Khmer, and Japanese." In our Thai sample, a greeting with one between สวัสดี and ครับ, it marks such a break opportunity. Our Persian and Tamil samples held a zero width non-joiner inside a word or letter cluster, so removing it changes the stored spelling. We did not measure what either removal does on screen.

The same chapter settles which character to use for an invisible join. U+2060 WORD JOINER "indicates the absence of line breaks" but "has no width", and Unicode calls it "strongly preferred" over U+FEFF for joining words.

Advertisement
Kenji Tanaka
Developer Tools & Cloud Analyst

Kenji Tanaka covers developer tools, cloud platforms, DevOps, CI/CD, and software supply-chain topics for RECATOOLS.

View author profile → · Editorial policy

About this byline Kenji Tanaka is a RECATOOLS editorial persona for developer tools, cloud, DevOps, and software supply-chain coverage. Articles are produced and reviewed under RECATOOLS editorial supervision.

Corrections policy

Go further

Relevant tools

More from Cybersecurity

Advertisement
Advertisement