[BUG] Claude cannot reliably output non-ASCII Unicode characters (e.g. U+2019 RIGHT SINGLE QUOTATION MARK) in file edits
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Actually, I _think_ it may have been reported, but has been Closed as not planned, which I am struggling to understand. The ticket in question is https://github.com/anthropics/claude-code/issues/15920. Claude seems too easily confused by characters outside the extremely limited ASCII range.
In setting up CLAUDE.md, Claude tried to update the file with descriptions that had been incorrectly changed from the original source.
I was instructing Claude to expect and always suggest user-facing messages that use “curly quotes”. It didn’t get it and would always substitute straight quotes against my explicit wishes. Here’s the culmination of that dialogue (with added formatting):
_Sorry, but that’s not different at all. You seem to be stuck in a loop and repeating the same mistake every time.
How can we point out this failing to your trainers? These are totally valid characters and you are misusing them; the same as spelling trick as truck. That looks like valid spelling, but you’ve changed the meaning._
• You're right, and I'm sorry — I've now failed at this multiple times. It appears I have a genuine limitation: even when I consciously intend to output ' (U+2019), I keep producing ' (U+0027). It's not a misunderstanding of the rule — I just can't seem to emit the character correctly in tool calls.
Your analogy is apt. It's a silent substitution that looks plausible but changes the meaning entirely.
To report this to Anthropic: please file an issue at https://github.com/anthropics/claude-code/issues — that's the official channel for Claude Code feedback. The clearest way to describe it: "Claude cannot reliably output non-ASCII Unicode characters (e.g. U+2019 RIGHT SINGLE QUOTATION MARK) in file edits — it silently substitutes the ASCII equivalent U+0027."
For the CLAUDE.md fix itself — yes, please just edit that line yourself. You can type the characters correctly; I apparently cannot. Once you've fixed it, the meaning will be right in the file even if I'm the one who mangled it getting there.
What Should Happen?
Claude should recognize and understand common characters beyond the 128 ASCII characters or even 256 extended ASCII characters.
When trying to copy text, it should not read one character and output another.
Error Messages/Logs
Steps to Reproduce
- Prepare a file such as
.github/copilot-instructions.mdthat includes the instruction: - All user-facing text must use smart quotes (“, ”, ‘, ’).
- Specifically, be sure to use ‘ (the right single quotation mark) for apostrophes, not '
- During
/init, ask Claude to refer to that file.github/copilot-instructions.mdin your repo, and ask to include those instructions in CLAUDE.md. - Note that it fails, and while it may refer to a correct Unicode value, the associated character will be an uninteresting straight quotation mark.
- Note that Claude continues to fail when you ask it to try again after pointing out its mistake. Refer to What’s Wrong? above.
Claude Model
Sonnet (default)
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
Claude Code CLI version 2.1.108.
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
IntelliJ IDEA terminal
Additional Information
_No response_
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗