Edit tool converts Unicode typographic apostrophes to ASCII apostrophes
Resolved 💬 3 comments Opened Feb 3, 2026 by codiceovvio Closed Feb 7, 2026
Description
When using the Edit tool to write text containing Unicode typographic apostrophes (' U+2019), they are being converted to ASCII apostrophes (' U+0027). This causes syntax errors in languages like PHP where single quotes delimit strings.
Steps to Reproduce
- Read a PHP file containing strings with typographic apostrophes (e.g.,
'Carta d'identità') - Use the Edit tool to write new content that includes the same strings
- The typographic apostrophes (
'= E2 80 99 in UTF-8) are converted to ASCII apostrophes ('= 27 in hex)
Expected Behavior
Unicode characters should be preserved exactly as written, maintaining the original encoding.
Actual Behavior
Typographic apostrophes are converted to ASCII apostrophes, breaking PHP string syntax.
Example
Original (working):
label: 'Carta d'identità (Rappresentante Legale)'
Hex: 64e2 8099 69 for d'i
After Edit tool:
label: 'Carta d'identità (Rappresentante Legale)'
Hex: 6427 69 for d'i
This results in PHP parse error: unexpected identifier "identità", expecting ")" because the ASCII apostrophe closes the string prematurely.
Environment
- Claude Code CLI
- Model: Claude Opus 4.5
- Platform: Linux
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗