The problem
Publishing platforms are built to make prose look polished. To do that, they silently rewrite the characters you type. A straight apostrophe becomes a curly one. A double quote becomes a typographic pair. A plain hyphen becomes an en or em dash. And in justified or tightly-spaced layouts, ordinary spaces are quietly swapped for non-breaking spaces ( , the character U+00A0) to control line wrapping.
None of that matters when the content is an article. It matters enormously when the content is a code snippet. A programming language treats U+201C (“) and U+0022 (") as two completely different characters — only one of which opens a string. To the human eye the two are nearly identical. To the parser, one is valid syntax and the other is garbage.
What it looks like in the editor
Here is a two-line snippet copied straight from a blog post into a .js file. It reads perfectly. Two characters are not what they appear to be:
const msg = “Build shipped”; console.log(msg);2 invisible passengers · 0 visible clues
The highlighted box after const is a non-breaking space, not a normal one. The highlighted quotes are curly U+201C/U+201D, not straight U+0022. Strip the highlighting and your eyes can’t tell.
The error a compiler actually throws
Run that file and the language doesn’t mention quotes, blogs, or hidden spaces. It points a caret at a column and gives you a message that sends you hunting through perfectly normal-looking code:
$ node app.js file:///app.js:1 const msg = “Build shipped”; ^ SyntaxError: Invalid or unexpected tokencryptic · points at column, not cause
“Invalid or unexpected token” is the compiler’s way of shrugging. Python is no friendlier — a stray U+00A0 in your indentation surfaces as SyntaxError: invalid non-printable character U+00A0, and developers can lose an hour re-reading logic that was never wrong.
The same snippet, run through the format-killer
Paste the snippet into cleanplaintext.com and run Straighten Quotes (which also converts non-breaking spaces back to ordinary ones). Every curly quote collapses to a straight one, the hidden U+00A0 becomes a plain space, and what lands back in your editor is pure, compilable text:
const msg = "Build shipped";
console.log(msg);
pure ASCII · ready to run
$ node app.js Build shippedcompiles first try
The sanitation happens locally on your device. Only pure ASCII / standard Unicode characters are handed back, so the snippet drops straight into a clean scripting environment.
Why a single character costs an hour
The damage is out of all proportion to its size, for three reasons:
- The error points at the symptom, not the cause. The caret lands on a quote or a space that looks completely ordinary, so you reread the logic instead of the bytes.
- The characters are invisible by design. Smart quotes are meant to look like real quotes, and a non-breaking space is meant to look like a space. Nothing in the editor flags them unless you’ve configured it to.
- It survives copy-paste. Sharing the “working” snippet with a teammate copies the bad characters too, so the bug reproduces on their machine and the confusion spreads.
The clean fix
Make a plain-text pass a reflex whenever code crosses out of a rich-text surface — a blog, a doc, a wiki, a chat message, a PDF. Drop the snippet into cleanplaintext.com, run Straighten Quotes (or Full Clean for everything at once), and paste the result into your editor. Curly quotes, em dashes, ellipses, and non-breaking spaces are all normalised in a single local pass — nothing is uploaded, and the snippet that reaches your compiler contains only the characters the parser expects.