claude-code - 💡(How to fix) Fix [BUG] Claude cannot reliably output non-ASCII Unicode characters (e.g. U+2019 RIGHT SINGLE QUOTATION MARK) in file edits [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#48229Fetched 2026-04-15 06:29:32
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
0
Timeline (top)
labeled ×4commented ×1

Error Message

Error Messages/Logs

RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • 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

  1. Prepare a file such as .github/copilot-instructions.md that includes the instruction:
    1. All user-facing text must use smart quotes (“, ”, ‘, ’).
    2. Specifically, be sure to use ‘ (the right single quotation mark) for apostrophes, not '
  2. During /init, ask Claude to refer to that file .github/copilot-instructions.md in your repo, and ask to include those instructions in CLAUDE.md.
  3. Note that it fails, and while it may refer to a correct Unicode value, the associated character will be an uninteresting straight quotation mark.
  4. 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

extent analysis

TL;DR

Claude Code may need a fix or workaround to handle non-ASCII Unicode characters, such as the RIGHT SINGLE QUOTATION MARK (U+2019), which it currently substitutes with the ASCII equivalent (U+0027).

Guidance

  • The issue seems to be related to Claude's character encoding or output handling, specifically with non-ASCII Unicode characters.
  • To verify the issue, follow the steps to reproduce provided in the issue body, which involve preparing a file with specific instructions and asking Claude to refer to it during initialization.
  • As a potential workaround, users can manually edit the affected files, such as CLAUDE.md, to correct the character substitutions.
  • It may be helpful to investigate or wait for an update to the Claude Code CLI, as the issue has been reported and closed as "not planned" in the past.

Example

No code snippet is provided, as the issue is related to character encoding and output handling, rather than a specific code snippet.

Notes

The issue may be specific to the Sonnet model or the Claude Code CLI version 2.1.108, and it is unclear if this is a regression or a known limitation.

Recommendation

Apply workaround: Manually editing the affected files to correct character substitutions seems to be the most feasible solution at this time, given that the issue has been reported and closed as "not planned" in the past.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING