The Two Worlds of Quotation Marks
To human eyes, the difference between "text" and “text” is a subtle aesthetic preference. In printed books and magazines, curved marks (known as curly quotes, smart quotes, or typographer's quotes) look professional, legible, and balanced.
To a computer parser, compiler, or database engine, they are entirely different creatures. Pasting curly quotes into a script, a terminal command, an API payload, or a CSV file is one of the most common causes of silent data corruption and runtime errors.
Comparison Table: Codepoints & Encoding
| Mark Name | Glyph | Codepoint | Encoding (Bytes) | Valid in Code / JSON? |
|---|---|---|---|---|
| Straight Single Quote (Apostrophe) | ' |
U+0027 |
1 byte (ASCII 39) | Yes |
| Straight Double Quote | " |
U+0022 |
1 byte (ASCII 34) | Yes |
| Left Single Curly Quote | ‘ |
U+2018 |
3 bytes (UTF-8) | No (Syntax Error) |
| Right Single Curly Quote | ’ |
U+2019 |
3 bytes (UTF-8) | No (Syntax Error) |
| Left Double Curly Quote | “ |
U+201C |
3 bytes (UTF-8) | No (Syntax Error) |
| Right Double Curly Quote | ” |
U+201D |
3 bytes (UTF-8) | No (Syntax Error) |
Why Do Curly Quotes Break Downstream Systems?
- Compilers & Interpreters (Python, JavaScript, Bash): Programming languages define string literals using ASCII 34 (
") or ASCII 39 ('). When an interpreter encounters“hello”, it does not recognize the boundary of a string literal. It assumes“is an invalid variable name, throwingSyntaxError: invalid character in identifier. - JSON Data Payloads: The official JSON specification (RFC 8259) explicitly mandates ASCII double quotes (
U+0022) for all object keys and string values. A single curly quote will causeJSON.parse()to crash. - SQL Queries & CSV Imports: When a customer name with a curly apostrophe (like
O’Connor) is imported into a naive CSV parser configured strictly for ASCII delimiters, the parser may fail on row 1,000 withunexpected tokenpointing at the wrong line. - The SMS Encoding Trap: Cellular SMS uses the 7-bit GSM-7 character set, allowing 160 characters per message. Because curly quotes are not part of GSM-7, pasting a single curly apostrophe forces your mobile carrier to re-encode the entire message into 16-bit UCS-2. This drops your message capacity from 160 characters down to **70 characters**, tripling your transmission cost.
Why Word Processors Convert Quotes Behind Your Back
The typewriter keyboard was designed with limited space, so mechanical typewriters used a single bidirectional quote (") to serve as opening quotes, closing quotes, inch marks, and seconds.
When Microsoft Word, Google Docs, Apple Pages, and CMS editors were created, developers added an automatic feature called "Smart Quotes". As you type, the application guesses whether a quote is opening or closing based on preceding whitespace and replaces your straight keystroke with a curved Unicode character.
When you copy that text out of Google Docs or Slack into your terminal or code editor, the curly Unicode bytes travel along with it.
How to Convert Curly Quotes to Straight Quotes
To normalize your text for programming, data cleaning, or technical writing:
- Using Text Cleaner: Paste your document into our free Clean Pasted Text tool. It detects all varieties of curly quotes and converts them to standard ASCII straight quotes in one click.
- Disable Smart Quotes in Word / Docs: In Google Docs, go to Tools → Preferences → General and uncheck "Use smart quotes". In macOS, go to System Settings → Keyboard → Text Replacements and turn off "Use smart quotes and dashes".
Frequently Asked Questions
Are straight quotes ever appropriate in formal publishing?
In printed literature and high-end typography, curly quotes remain the standard standard for readability. However, in technical documentation, programming books, and digital configuration guides, straight quotes are preferred to ensure code examples are copy-pasteable without errors.
Can a Python script automatically detect curly quotes?
Yes. You can use regex to replace curly quotes: re.sub(r'[“”]', '"', text) and re.sub(r'[‘’]', "'", text).
What is the difference between a prime mark and a straight quote?
True mathematical prime marks (′ for feet/minutes, ″ for inches/seconds) have their own codepoints (U+2032 and U+2033). In digital typing, straight quotes are routinely substituted for primes.
Does Text Cleaner alter the words inside quotation marks?
Never. Text Cleaner strictly normalizes character codepoints and punctuation marks; it never alters, rewrites, or deletes your wording.