CopyClean
Clipboard hygiene

Smart quotes, broken builds: why curly quotes crash code and configs

Curly quotes look nicer in prose and are syntax errors everywhere else. Why smart quotes break JSON, YAML and shell commands, and how to stop pasting them.

April 28, 2026 · 3 min read · CopyClean Blog

Somewhere right now, a developer is staring at a JSON file that will not parse, a YAML config that will not load, or a shell command copied from a blog post that fails with the least helpful error imaginable. The file looks perfect. The command looks identical to the working one in the docs.

The culprit, a remarkable share of the time, is a quotation mark wearing makeup.

what you pasted SyntaxError

{key: value}

what JSON requires

{"key": "value"}

Two characters pretending to be four

Your keyboard has two quote keys: " and '. Typography has at least six relatives: opening and closing double quotes, opening and closing single quotes, and a family of primes. Word processors, chat apps and websites "helpfully" convert your straight keystrokes into the curly versions as you type - a feature called smart quotes - because curly quotes look better in prose.

They do look better in prose. The problem is that parsers do not read prose.

  • JSON requires straight double quotes as delimiters. Feed it {“key”: “value”} and it fails - and here is the cruel part: many validators report a generic parse error at the position without saying "your quotes are curly", because visually they cannot show you the difference either. This exact confusion fills bug trackers; some projects added special "did you paste curly quotes?" error messages just to stop the support tickets.
  • YAML, TOML, .conf, .env files all expect ASCII quotes. A curly quote in a config either errors or, worse, silently becomes part of the value.
  • Shell commands are the classic. A command copied from a styled web page arrives with curly quotes, and bash treats them not as quoting characters but as literal text inside an argument. The command runs and does the wrong thing.
  • Every programming language wants straight quotes for string delimiters. A curly quote inside source code is at best a syntax error and at worst a string that contains a character you did not intend.

The same conversion also produces the curly apostrophe () - so it’s in pasted text is not the it's your grep is looking for - and Unicode goes further with lookalike apostrophes that are technically letters (U+02BC), which pass some validators and then break search, diffs and deduplication downstream.

Where they sneak in

You rarely type a curly quote deliberately. They arrive when text round-trips through something with smart punctuation enabled: Word, Google Docs, Pages, Slack, note apps, CMS editors, iOS keyboards - and AI assistants, whose output is curly-quoted by default because their training data was published prose. (The quotes usually travel with their friends: the em dash and a real ellipsis character.)

You can turn smart punctuation off app by app - macOS has a checkbox in Keyboard settings, iOS under Smart Punctuation - but that only fixes what YOU type. It does nothing about what you copy, and copying is how the quotes actually get into your configs.

The clipboard is the checkpoint

Everything you paste passes through the clipboard, which makes it the one place a fix actually covers every source. CopyClean normalizes smart quotes, curly apostrophes and primes back to straight ASCII the instant you copy - and it is code-aware: text copied from prose sources gets its quotes straightened before it ever reaches your editor, while copied CODE is recognized and left byte-for-byte intact apart from invisible watermarks - a quote inside a string literal might be exactly what the author meant.

Prose can keep its typography. Your parser gets keyboard characters. The trick is knowing which one you are pasting into - or having the clipboard know it for you.

Clean every copy, automatically CopyClean removes hidden characters, AI typography and link trackers the instant you copy. Free 7-day trial, then 12.99 USD once. macOS 14+.
Download on theMac App Store