CJK (Japanese) text garbled in CLI output and gh commands when locale is ja_JP.UTF-8
Resolved 💬 3 comments Opened Apr 7, 2026 by finelagusaz Closed Apr 7, 2026
Bug report
Description
When the terminal locale is set to ja_JP.UTF-8, two character encoding (mojibake) issues occur:
- CLI response rendering — Claude Code's responses containing Japanese characters are sometimes garbled in the terminal output.
- GitHub CLI integration — When Claude Code executes
gh issue createorgh pr createwith Japanese text in the title/body, the resulting GitHub issue/PR contains garbled characters. (Workaround: using--body-filewith a temp file instead of--bodyheredoc, ref: #40396)
Environment
- Claude Code version: 2.1.92
- OS: macOS (Darwin 25.4.0)
- Terminal: iTerm.app 3.6.9
- LANG:
ja_JP.UTF-8 - Shell: zsh
- TERM: xterm-256color
Steps to reproduce
- Set terminal locale to
ja_JP.UTF-8(export LANG=ja_JP.UTF-8) - Configure Claude Code to respond in Japanese (e.g., via CLAUDE.md instruction)
- Observe garbled characters in CLI output
- Ask Claude Code to create a GitHub issue with Japanese text via
gh issue create --body "..."— the resulting issue contains mojibake
Expected behavior
Japanese (and other CJK) text should render correctly in both CLI output and when passed to shell commands like gh.
Additional context
The --body-file workaround (writing body to a temp file first) avoids the gh mojibake, suggesting the issue may be in how Claude Code passes multibyte strings to shell arguments.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗