claude-code - 💡(How to fix) Fix AskUserQuestion / tool calls render Japanese (non-ASCII) as raw \uXXXX Unicode escape sequences [1 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#56003Fetched 2026-05-05 06:00:43
View on GitHub
Comments
0
Participants
1
Timeline
4
Reactions
0
Participants
Timeline (top)
labeled ×4

When Claude invokes the AskUserQuestion tool (and likely other tools) with Japanese/non-ASCII text in question / header / option.label / option.description, the model's tool input JSON arrives at the TUI with Unicode characters serialized as \uXXXX escape sequences. The TUI surfaces those raw escape literals to the user instead of rendering decoded UTF-8.

Root Cause

Suspected root cause

Fix Action

Workaround

The user-facing impact can be reduced if Claude is instructed to emit raw UTF-8 in tool inputs (no \u escapes). Anthropic's CLAUDE.md guidance for users in CJK locales is already moving in this direction (Unicode escape (\\uXXXX) を手打ちで生成しない — UTF-8 直接で渡す). But the fix should also live on the TUI side so non-instructed sessions are not broken for Japanese / Chinese / Korean / Arabic / etc users.

Code Example

Codex 起動しますか?

---

Codex 起動しますか?
RAW_BUFFERClick to expand / collapse

Environment

  • Claude Code: 2.1.126
  • OS: macOS 26.2 (Build 25C56)
  • Terminal: Ghostty
  • Model: Opus 4.7 (1M context, claude-opus-4-7[1m])

Summary

When Claude invokes the AskUserQuestion tool (and likely other tools) with Japanese/non-ASCII text in question / header / option.label / option.description, the model's tool input JSON arrives at the TUI with Unicode characters serialized as \uXXXX escape sequences. The TUI surfaces those raw escape literals to the user instead of rendering decoded UTF-8.

Reproduction (observed in a working session, not a synthetic minimal repro)

The model issued AskUserQuestion calls during a Japanese-language session. When Ryo (the user) inspected the rendered question chip / option labels, they saw text like:

Codex 起動しますか?

instead of the intended:

Codex 起動しますか?

This happened across multiple AUQ invocations in the same session — every Japanese string in question, header, option.label, and option.description came through with raw \u escapes.

Expected behavior

Tool input string fields should be decoded back to UTF-8 before being shown in the TUI. JSON strings are equivalent whether the model emits "コデックス" or "コデックス" — the TUI should treat them identically when rendering to the terminal.

Actual behavior

Raw \uXXXX literal sequences are shown to the user. This makes Japanese AUQ chips and option lists effectively unreadable.

Suspected root cause

Two layers may contribute:

  1. Model side: Claude (Opus 4.7 in this case) sometimes emits tool input JSON with non-ASCII characters escaped as \uXXXX. This is RFC 8259-compliant but probably an RLHF training artifact (the model generalizes from JSON examples that escape non-ASCII). It is documented in some style guides that LLMs do this for English-trained reasons.
  2. TUI side: The renderer for AskUserQuestion question text / option labels appears to pass the raw JSON-decoded string through without re-decoding \u sequences. If the JSON parser used for the tool call upstream is producing the literal 6-character sequence (instead of the single character U+8D77), the TUI shows it verbatim.

It looks more like the TUI render path issue: a properly-parsed JSON string would already contain (U+8D77) regardless of whether the source said or . So somewhere upstream the JSON is being treated as plain text or the escapes survive into the displayed string. Worth verifying with a captured tool call payload.

Workaround

The user-facing impact can be reduced if Claude is instructed to emit raw UTF-8 in tool inputs (no \u escapes). Anthropic's CLAUDE.md guidance for users in CJK locales is already moving in this direction (Unicode escape (\\uXXXX) を手打ちで生成しない — UTF-8 直接で渡す). But the fix should also live on the TUI side so non-instructed sessions are not broken for Japanese / Chinese / Korean / Arabic / etc users.

Impact

  • AskUserQuestion is unusable for Japanese-only sessions (cannot read the question chips or options without manual decoding).
  • Likely affects other tools that surface tool inputs in the TUI (slash command args, tool argument summaries, etc.).
  • Not a code-correctness issue (the underlying JSON is valid), but a UX issue affecting all CJK users.

Suggested fix priorities

  1. (TUI) Always pass tool input string fields through a JSON-aware decode before rendering.
  2. (Model) Tighten RLHF guidance / system prompt to prefer raw UTF-8 in tool input JSON.
  3. (Docs) Note this as a known issue if a fix is pending.

Happy to provide a captured AskUserQuestion payload (with the raw \uXXXX literals visible) if that helps reproduce on your side.

extent analysis

TL;DR

The most likely fix is to modify the TUI renderer to decode \u sequences in tool input strings before displaying them to the user.

Guidance

  • Verify that the JSON parser used for tool calls is correctly parsing the input JSON and not producing literal \u sequences.
  • Check the TUI render path to ensure it is not treating the JSON as plain text and passing the raw \u sequences through to the display.
  • Consider implementing a JSON-aware decode step in the TUI renderer to handle \u sequences correctly.
  • Instructing Claude to emit raw UTF-8 in tool inputs (without \u escapes) may also help reduce the user-facing impact.

Example

No code snippet is provided as the issue does not contain sufficient information to create a specific example.

Notes

The fix should be applied on the TUI side to ensure that all tool inputs are correctly decoded and displayed, regardless of the locale or language used.

Recommendation

Apply a workaround by modifying the TUI renderer to decode \u sequences in tool input strings, as this is the most direct way to address the user-facing issue.

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…

FAQ

Expected behavior

Tool input string fields should be decoded back to UTF-8 before being shown in the TUI. JSON strings are equivalent whether the model emits "コデックス" or "コデックス" — the TUI should treat them identically when rendering to the terminal.

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 AskUserQuestion / tool calls render Japanese (non-ASCII) as raw \uXXXX Unicode escape sequences [1 participants]