claude-code - 💡(How to fix) Fix [BUG] Japanese (CJK) characters garbled during streaming output [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#45010Fetched 2026-04-09 08:15:29
View on GitHub
Comments
1
Participants
2
Timeline
6
Reactions
0
Timeline (top)
labeled ×4commented ×1cross-referenced ×1

Root Cause

  • This is NOT the spinner/status line garbling reported in #42177 — this affects the main assistant output text
  • The issue reproduces across multiple terminal emulators (Ghostty, VS Code terminal), ruling out terminal-specific rendering bugs
  • The issue also reproduces when using cmux (terminal multiplexer), but is not caused by it since it reproduces without cmux as well
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?

Japanese (CJK multi-byte) characters in the assistant's streaming output are intermittently garbled/corrupted. Characters appear to be split at token boundaries during streaming, resulting in broken/missing characters in the rendered text.

Examples of corrupted output observed:

  • 50チケッ��なら (expected: 50チケットなら)
  • 関連チケットと Scope外に反映しま�� (missing final character)
  • PR #356 ��修正に戻りますか? (corrupted character mid-sentence)

How to Reproduce

  1. Set locale to ja_JP.UTF-8
  2. Have a conversation in Japanese where Claude generates multi-paragraph responses
  3. Observe that some CJK characters are garbled/missing in the streamed output

The issue occurs randomly during streaming. It is not specific to any particular character — different characters are corrupted in different responses.

Environment

  • Claude Code version: 2.1.94
  • OS: macOS (Darwin 25.3.0)
  • Terminal: Ghostty (xterm-ghostty), also reproduced in VS Code integrated terminal and via cmux
  • Shell: zsh
  • Locale: ja_JP.UTF-8

Additional Context

  • This is NOT the spinner/status line garbling reported in #42177 — this affects the main assistant output text
  • The issue reproduces across multiple terminal emulators (Ghostty, VS Code terminal), ruling out terminal-specific rendering bugs
  • The issue also reproduces when using cmux (terminal multiplexer), but is not caused by it since it reproduces without cmux as well

extent analysis

TL;DR

The issue with garbled Japanese characters in Claude Code's streaming output may be resolved by adjusting the tokenization or encoding handling for CJK characters.

Guidance

  • Verify that the issue is not related to the terminal emulator or shell by testing with different setups, as the user has already done.
  • Investigate the tokenization process in Claude Code to see if it's splitting CJK characters incorrectly, potentially causing the corruption.
  • Check the encoding settings in Claude Code and the environment to ensure that UTF-8 is properly supported and handled.
  • Consider testing with a different locale or character set to isolate if the issue is specific to Japanese characters or a more general problem.

Example

No specific code example can be provided without more details on Claude Code's internal workings, but checking the encoding and tokenization handling in the codebase may look something like reviewing character encoding settings or tokenization algorithms for proper handling of multi-byte characters.

Notes

The issue seems to be related to how Claude Code handles CJK characters during streaming output, possibly due to incorrect tokenization or encoding. However, without access to the codebase or more specific details on how Claude Code processes text, it's challenging to provide a precise fix.

Recommendation

Apply a workaround by adjusting the character encoding or tokenization settings in Claude Code, if possible, to better handle CJK characters until a more permanent fix can be implemented. This approach is recommended because it directly addresses the likely cause of the issue and can provide a temporary solution for users experiencing the problem.

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

claude-code - 💡(How to fix) Fix [BUG] Japanese (CJK) characters garbled during streaming output [1 comments, 2 participants]