Why Should You Straighten Curly Smart Quotes?
Straightening curly quotes replaces 3-byte Unicode punctuation (U+2018–U+201E) with 1-byte ASCII quotes (" and ') that compilers, JSON parsers, SQL engines, and shell terminals require.
Modern word processors (like Apple Pages, Microsoft Word, and Google Docs) automatically replace straight typewriter quotes with typographic curly smart quotes (“ ” ‘ ’). While aesthetically pleasing in print, curly quotes cause severe errors when pasted into:
- Code Editors & Terminals: Syntax errors in Python, JavaScript, Shell scripts, Swift, and C++.
- Data Formats: Parse errors in JSON, YAML, TOML, and XML files.
- Databases: SQL query syntax failures.
- Configuration Files: Broken environment settings in Docker, NGINX, and CI/CD pipelines.
What Unicode Quote Code Points Are Converted?
The engine runs s/[\u201C\u201D\u201E]/"/g and s/[\u2018\u2019\u201A]/'/g to convert all curved quotation marks and typographic apostrophes into straight ASCII equivalents:
Text Cleaner normalizes all regional and typographic curly quotes:
- Left and Right Double Quotes (
“ ”) →" - Left and Right Single Quotes (
‘ ’) →' - German and Polish Low Double Quotes (
„ ”) →" - French and Italian Guillemets (
« ») →" - Single Low Quotes and Apostrophes (
‚ ’) →'
Worked Before / After Example: Input “Smart quotes” and ‘single curly quotes’ often cause syntax errors in “JSON” and code. (86 characters, 14 words, 6 curly quotes) → Output "Smart quotes" and 'single curly quotes' often cause syntax errors in "JSON" and code. (86 ASCII characters, 14 words; 4 double curly quotes → ", 2 single curly quotes → ').
| Curly Quote Name & Unicode Code Point | Target ASCII Code Point | Input Example (Before) | Output Result (After) |
|---|---|---|---|
Left & Right Double Quotes (U+201C “, U+201D ”) |
U+0022 (") |
{“status”: “ok”} (16 chars, 24 bytes) |
{"status": "ok"} (16 chars, 16 bytes) |
Left & Right Single Quotes (U+2018 ‘, U+2019 ’) |
U+0027 (') |
WHERE name = ‘O’Connor’ (23 chars) |
WHERE name = 'O'Connor' (23 chars) |
Double Low-9 Quote (U+201E „) |
U+0022 (") |
„Hallo Welt” (12 chars) |
"Hallo Welt" (12 chars) |
Single Low-9 Quote (U+201A ‚) |
U+0027 (') |
‚Beispiel’ (10 chars) |
'Beispiel' (10 chars) |