claude-code - 💡(How to fix) Fix Intermittent Korean (CJK) character corruption in model 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#46863Fetched 2026-04-12 13:31:05
View on GitHub
Comments
1
Participants
2
Timeline
4
Reactions
0
Author
Timeline (top)
labeled ×3commented ×1

Intermittent UTF-8 corruption of Korean (CJK) characters in Claude Code model output. Characters are partially rendered or replaced with replacement characters (U+FFFD).

Root Cause

Intermittent UTF-8 corruption of Korean (CJK) characters in Claude Code model output. Characters are partially rendered or replaced with replacement characters (U+FFFD).

Code Example

#N개의 상품을 찾았습니다.

---

#N개의 상품을 ��았습니다.
RAW_BUFFERClick to expand / collapse

Description

Intermittent UTF-8 corruption of Korean (CJK) characters in Claude Code model output. Characters are partially rendered or replaced with replacement characters (U+FFFD).

Example

Expected output:

#N개의 상품을 찾았습니다.

Actual output:

#N개의 상품을 ��았습니다.

The corrupted text was generated by the model and passed through to a tool call (curl/API push), causing corrupted data to be stored in an external system.

Environment

  • Claude Code CLI (macOS, Darwin 24.6.0)
  • Model: claude-sonnet-4-6
  • Started occurring approximately April 9-10, 2026
  • Intermittent — not every output, but happens a few times per long session

Impact

When corrupted output is used in tool calls (e.g., writing to files, API calls), the corruption propagates to external systems without the user noticing until later.

Steps to Reproduce

  1. Use Claude Code in a long session with heavy Korean text output
  2. Generate text containing Korean characters through tool calls
  3. Occasionally, some characters will be corrupted

No reliable minimal reproduction yet — it appears to be intermittent and may be related to session length or output volume.

extent analysis

TL;DR

Verify and ensure proper UTF-8 encoding handling in the Claude Code model output and subsequent tool calls to prevent character corruption.

Guidance

  • Investigate the encoding settings in the Claude Code CLI and the model configuration to ensure UTF-8 is consistently used.
  • Check the tool call (curl/API push) implementation to verify that it properly handles UTF-8 encoded strings, potentially setting explicit encoding parameters.
  • Consider adding logging or debugging statements to capture and inspect the output immediately after generation by the model and before it is passed to external tools, to identify where the corruption occurs.
  • Test the system with a controlled, repeated input that previously caused corruption to see if the issue can be reliably reproduced and if any patterns emerge.

Example

No specific code example can be provided without more details on the implementation, but ensuring that all components (the model, the CLI, and the tool calls) are configured to work with UTF-8 encoding is crucial.

Notes

The intermittent nature and the specific corruption of Korean characters suggest an encoding issue that might be related to how the model or subsequent processing handles Unicode characters. Without more specific details on the implementation or the ability to reproduce the issue reliably, the guidance focuses on verifying encoding consistency across the system.

Recommendation

Apply workaround: Ensure all system components explicitly use UTF-8 encoding to handle character data, as this is likely to mitigate the corruption issue until a more permanent fix can be identified and applied.

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