Curly quotes and prime marks

Typographic quotation marks that curl towards the text they enclose, along with the prime and double prime used for feet, inches, minutes and seconds. All are visible, and all are what a typesetter would use.

How it works

Typographic quotation marks are separate code points from the ASCII apostrophe and double quote: U+2018 and U+2019 for single, U+201C and U+201D for double, plus the low and reversed variants used by German and other conventions, and the prime marks U+2032 and U+2033 used for feet, inches, minutes and seconds. Word processors substitute them as you type, using the surrounding characters to guess opening from closing. Rendering is the only place they are equivalent to their ASCII counterparts; everywhere else they are different characters. A curly apostrophe inside a source-code string literal terminates nothing, so the parser either errors or, worse, accepts a string that differs from the one you meant. A CSV field wrapped in curly quotes is not quoted as far as the parser is concerned, so an embedded comma splits the row. A search for a contraction typed with a straight apostrophe misses every instance written with a curly one, which is why site search often fails on text pasted from a document.

What it is legitimately for

Correct typography in published prose. Word processors have substituted them automatically for decades, which is why they are everywhere.

What it breaks

  • A curly apostrophe inside a string literal in code is a syntax error, or worse, silently a different string.
  • A CSV field quoted with curly quotes is not quoted at all as far as the parser is concerned.
  • Search for a contraction typed with a straight apostrophe misses every instance written with a curly one.

How to find it yourself

Look at the shape: straight quotes are vertical, curly ones lean. In a hex dump they are the e2 80 98 through e2 80 9d range.

What Clipboard Sanitizer does

Replaced with the straight ASCII equivalent. Prime and double prime become an apostrophe and a double quote.