Japanese (CJK) characters occasionally corrupted in model output (mojibake)
Resolved 💬 3 comments Opened Apr 5, 2026 by mitu4tu Closed Apr 9, 2026
Description
When using Claude Code on Windows, some Japanese (CJK multi-byte UTF-8) characters are occasionally corrupted in both:
- Direct text output to the terminal (conversation responses)
- File writes via the Write tool
The corruption appears as replacement characters (� / �� / ���).
Environment
- OS: Windows 11 Home 10.0.26220
- Shell: bash (Git Bash)
- Model: Claude Opus 4.6 (1M context)
- Claude Code: latest CLI version
Examples
| Context | Expected | Actual |
|---------|----------|--------|
| Terminal output | 進めますか? | ���めますか? |
| Write tool (TASKS.md) | 本番リリース(PR #447) | 本番リリース��PR #447) |
| Write tool (TASKS.md) | マージ済み | マー��済み |
| Write tool (signup-form.tsx) | 利用規約 | 利用��約 |
| Write tool (signup-form.tsx) | パスワード | パ���ワード |
Reproduction
- Not deterministic — the same characters sometimes render correctly, sometimes corrupted
- More frequent with the Write tool (full file content) than with Edit tool (diff only)
- Also occurs in plain text responses (not file writes)
Observations
- Edit tool (small diffs) rarely exhibits this issue
- Write tool (full file rewrite with long Japanese text) is more susceptible
- The corrupted bytes suggest UTF-8 multi-byte sequences split at token boundaries
Workaround
- Use Edit tool instead of Write tool for existing files
- Post-write grep for
�to detect and fix corruption
Expected behavior
All Japanese/CJK characters should render correctly in both terminal output and file writes.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗