Skip to content
13 min readUpdated 29 October 2026

“Non-Unicode” Characters: Encoding and Hidden Text

Separate Unicode, non-ASCII text, encoding errors and invisible characters. Learn how to diagnose a broken paste without damaging valid writing.

You paste a paragraph from an AI assistant into a CMS. It looks clean, but the layout shifts, search can't find a word you can plainly see, or a grammar checker flags something that seems to be nothing. The problem usually isn't the wording. It's a hidden character inside the string.

These characters can cause rendering glitches, failed searches, broken slugs and, in security-sensitive settings, hidden instructions. The answer isn't to remove every invisible character, because some are needed for certain languages and for typography. Identify what you are looking at, decide whether it belongs, and clean only what doesn't. If the text started in a PDF, this guide to how to paste from PDF without mess can help before it reaches your editor.

Table of Contents

Why pasted AI text sometimes looks broken

A paragraph can look identical before and after copying while the underlying characters change how software treats it. A zero-width space can split a word for search. A soft hyphen can be invisible on screen but affect wrapping. A direction control can change how mixed left-to-right and right-to-left text is displayed.

Typical symptoms:

  • Layout drift: a line breaks in an odd place, or a copied heading behaves differently from the original.
  • Search failures: you search for a visible word, but a hidden character splits it in two.
  • Mistaken suspicion: someone finds invisible characters and assumes they are an AI watermark. The text watermarks Google and Anthropic document for Gemini and Claude work through word choice and add no hidden characters, so stray invisible characters usually come from the copy path, an editor or a web page, and are not evidence of AI authorship.
  • Security exposure: hidden tag characters or direction controls can hide instructions from a human reviewer while software still reads them.

"Non-Unicode characters" is often used as a catch-all for these problems, but it isn't precise. Some troublesome characters are invalid or wrongly decoded. Others are valid Unicode used in the wrong place.

If text looks normal but behaves strangely, inspect the characters before rewriting the words.

It helps to separate encoding damage, legitimate formatting and covert content, because each needs a different response. You might repair broken encoding, keep a control a script depends on, or remove a suspicious tag sequence. Treating them all as stray spaces is how useful text gets damaged.

What "non-Unicode characters" means

Unicode is a shared numbering system for written text. It assigns code points to characters and gives software rules for interpreting them. Invisible characters such as U+FEFF ZERO WIDTH NO-BREAK SPACE, U+200B ZERO WIDTH SPACE, U+200C ZERO WIDTH NON-JOINER and U+200D ZERO WIDTH JOINER have been part of the standard since its early versions in the 1990s.

Strictly, a non-Unicode character would be something outside Unicode's repertoire. In everyday troubleshooting the phrase also covers malformed encodings, private-use characters, invisible controls and symbols that programs interpret inconsistently.

Think of Unicode as a numbered catalogue. A decoding error gives a symbol the wrong number. A private-use character uses a number reserved for local systems, so another system may show nothing useful. An invisible control can be perfectly valid and still change how text is read, searched or processed.

That gives three common problems:

  • Mojibake: visible corruption caused by decoding bytes with the wrong encoding, such as "café" instead of "café".
  • Invisible formatting: usually valid Unicode that changes layout, joining, direction or processing without a visible glyph.
  • Private-use content: characters with no shared meaning outside the system that assigned them.

Many of the invisible controls live in the General Punctuation block, alongside visible marks such as dashes and quotation marks.

"Non-ASCII" is a different idea again. ASCII covers only 128 basic characters, so accented letters, curly quotes, em dashes and every non-Latin script are non-ASCII while being perfectly valid Unicode. Text that stays inside ASCII, such as the text art in RewriteBar's ASCII prompt collection, avoids many encoding problems, but most real writing needs more than ASCII. Non-ASCII alone is not a reason to remove a character.

The main types of hidden characters

This table is a debugging reference, not a list of things to delete. U+200B, for example, can mark a permitted word or line break and is used in Thai, Myanmar, Khmer and Japanese text. U+200C and U+200D control joining in complex scripts.

Code point Name Intended purpose Common symptom
U+200B ZERO WIDTH SPACE A word or line-break opportunity with no visible width Search mismatches, odd word counts, broken slugs
U+200C ZERO WIDTH NON-JOINER Stops letters joining where a script would join them Wrong shaping if removed; a stray hidden character in Latin text
U+200D ZERO WIDTH JOINER Requests joining where supported; used in emoji sequences Broken ligatures or emoji if removed
U+2060 WORD JOINER Prevents a line break without visible spacing Text won't wrap, or behaves differently across editors
U+00AD SOFT HYPHEN Marks a possible hyphenation point Missing, visible or inconsistent hyphens after export
U+FEFF ZERO WIDTH NO-BREAK SPACE, also the byte order mark (BOM) Marks byte order at the start of a file; its use as a no-break space is deprecated A strange leading character, or failed matching when it appears mid-text
U+200E LEFT-TO-RIGHT MARK Influences direction in bidirectional text Mixed-language text shows in an unexpected order
U+200F RIGHT-TO-LEFT MARK Influences direction in bidirectional text Right-to-left fragments appear flipped or reordered
U+E000–U+F8FF Private Use Area Lets an application or vendor assign its own symbols Missing glyphs, boxes or system-specific behaviour
U+E0000–U+E007F Tags block Tag characters, mainly used today in some flag emoji, and open to misuse for hidden text Invisible payloads, filter bypasses, inconsistent AI interpretation

U+200B was moved from the space-separator category (Zs) to the format-control category (Cf) in Unicode 4.0.1, after a 2003 decision, because it affects line breaking without taking visible width. A 2008 proposal to the Unicode Technical Committee quotes that decision and argues for its importance as a word separator in Khmer, Thai and Myanmar text. It also records that using U+FEFF as a zero-width no-break space was deprecated in Unicode 3.2 in favour of U+2060 WORD JOINER. For a related visible-typography problem, see this guide on how to type a non-breaking hyphen. Hidden Unicode and statistical watermarking are separate mechanisms, as this comparison of hidden Unicode and statistical watermarks explains.

How these characters get into copied text

A copied paragraph passes through several systems, and each one can keep or reinterpret the string.

At the source, a chat interface, web page or document editor may include soft hyphens, zero-width spaces, joiners or direction controls. These can come from the page's HTML, the app's rendering and copy code, formatting conversions, the content itself, or occasionally deliberate insertion by a tool. Text can also contain homoglyphs, characters that look like ordinary letters but have different code points.

The clipboard usually carries the underlying characters, not just how they looked. A rich-text editor may then turn part of the paste into styled spans while leaving other controls as raw code points.

A four-step infographic illustrating the hidden journey of text involving AI processing and invisible characters.

Where trouble appears

A CMS sanitizer may remove some controls and keep others. Exporting to PDF or Markdown can make a soft hyphen visible, make it disappear, or keep it in a way that breaks search. Slug generation can reject or split input with zero-width spaces, and Markdown linters may flag characters you can't see in the editor.

That is why the same sentence can behave differently in a chat window, a document, a CMS and a PDF. What you see is one representation; each system processes the code points underneath.

Legitimate uses versus harmful cases

In a multilingual document, a hidden control may be essential. In an AI security context, the same kind of character can hide an instruction.

Devanagari and Arabic text can rely on joiners and non-joiners to shape letters correctly, so removing U+200C or U+200D without checking the language can change how words render. Soft hyphens help long words wrap in print or responsive layouts, and zero-width joiners hold multi-part emoji together.

The risk starts when a character serves a machine or an attacker rather than the reader.

Use case Character Who adds it Effect
Script shaping U+200C or U+200D Writer, input method or typesetter Controls joining so text renders correctly
Controlled wrapping U+00AD Publisher or layout system Offers a break point for long words
Direction handling Bidi controls Document system or multilingual author Keeps mixed-direction text readable
ASCII smuggling Tag characters Attacker or malicious input Hides instructions inside ordinary-looking text
Character-based marking Zero-width sequences or other hidden markers Some tools and proposed schemes (not the Gemini or Claude text watermarks, which work through word choice) Embeds a machine-readable pattern without visible change
Prompt injection Invisible controls or tags Attacker Delivers content a human reviewer may not notice

Unicode defines 12 characters with the Bidi_Control property. The W3C describes LRM and RLM as invisible marks that affect direction and recommends isolate controls (LRI, RLI, FSI and PDI) when you need to stop direction from spilling into surrounding text, as explained in the W3C guidance on bidirectional Unicode controls.

Security guidance treats ZWJ and ZWNJ with care in identifiers. UTS #39 records that from Unicode 15.0 they are classed as Default_Ignorable and Restricted for identifiers, as described in the Unicode security report. A workable rule: if a character helps the text read or render correctly, keep it where it's needed; if it seems to exist only to signal something to a machine, treat it as suspect. Our guide on how AI text watermarks work explains why provider text watermarks such as SynthID Text are in the wording, not in characters like these.

A practical cleaning workflow for writers and editors

Don't start with a blanket "remove Unicode" command. Find the characters, work out their roles, and keep the original so you can undo a bad cleanup.

For most writers, the quickest start is the free invisible character remover. It runs in your browser with no account or upload, identifies the supported hidden characters it finds, and leaves your wording alone, along with the controls that scripts and emoji need in context. If the problem is formatting rather than hidden characters, the plain text converter strips rich formatting or HTML, and the line break remover joins lines broken by PDF copying. All three are on the tools page.

A four-step checklist illustration detailing how to detect, identify, clean, and verify non-ASCII characters in text.

Detect and identify

Paste the text into a scanner or hex viewer that highlights non-ASCII code points. Note each character's code point, name and position.

Then ask where the text came from and what language it is in. A zero-width control inside Arabic or Indic text may be intentional. The same control inside an English slug, title or identifier is probably an unwanted artifact.

Clean selectively

If you are writing your own cleanup in JavaScript, a pattern like this targets common zero-width, direction, word-joiner, BOM, private-use and tag characters:

/[\u200B-\u200F\u2060-\u206F\uFEFF\uE000-\uF8FF\u{E0000}-\u{E007F}]/gu

The u flag is required for the tag range above U+FFFF. Treat this as a starting point, not a universal sanitizer: it also removes U+200C and U+200D, which some scripts and emoji need, and the tags block is used in some flag emoji.

  • Keep deliberately: leave script-shaping controls where the language and destination need them.
  • Replace carefully: turn a hidden word separator into an ordinary space only when the text needs a visible gap.
  • Strip suspicious characters: remove unexplained tag characters and hidden controls from security-sensitive content after checking their context.
  • Keep the original: store the untouched source in version control or a separate file first.

Find-and-replace improves readability, but it isn't a full security review. Check direction controls, homoglyphs, malformed sequences and tag characters separately.

Verify the result

Compare the text before and after cleaning. Check the word count, headings and links, and rescan the output for anything that survived. If the document uses several scripts, ask a fluent reader to check it or test it in the destination app.

The invisible character remover works for this rescan as well. Use it to see what is there, not as a reason to strip every invisible character automatically.

Quick reference checklist

Invisible doesn't mean bad. Some invisible characters control line breaks, direction, joining or emoji. Others arrive through copy and paste or hide instructions from people while software still reads them.

Before publishing or importing text:

  1. Detect: scan for non-ASCII characters, format controls, private-use code points and bidi controls.
  2. Identify: record each character's code point and where the text came from: a document, an AI chat, a CMS or an unknown source.
  3. Keep: leave controls needed for Arabic, Indic or other script shaping, emoji, and deliberate typography the destination needs.
  4. Strip: remove unexplained zero-width characters, suspicious tag characters and hidden markers from ordinary copy after checking context.
  5. Check: compare before and after, and test search, links, wrapping, word count and rendering in the destination.
  6. Record: keep the original and note what you removed, replaced or kept.

Direction controls can change rendering without changing how many characters you see; the General Punctuation block alone contains 11 of them, as listed in the General Punctuation reference. A field that looks blank still deserves inspection before it reaches a parser, editor, CMS or AI tool.

A quick reference chart titled When to Clean, explaining when to remove or keep specific text characters.

Clean characters from copied or unknown text when they have no clear purpose for the reader. Leave them when they are needed for correct rendering or intentional typography. If you didn't put a hidden character there on purpose, check it before publishing. If you want wording rewritten rather than characters cleaned, that's a separate job: Simple Unmark's main cleaner removes hidden Unicode and rewrites the text, aiming to preserve meaning, facts, numbers, names and tone, and the result still needs your review.

  • non unicode characters
  • invisible characters
  • zero width space
  • unicode cleanup
  • AI text watermarking

Related articles