[Windows] Clipboard copy produces garbled Chinese text after v2.1.92 update

Status Fixed / completed
Maintainer reply ✓ Yes — ashwin-ant
Activity 4 comments · opened Apr 6, 2026 · closed Apr 18, 2026
💡 Likely answer: A maintainer (ashwin-ant, collaborator) responded on this thread — see the highlighted reply below.

Description

After updating to Claude Code v2.1.92, copying Chinese text output from the Claude Code desktop app produces garbled characters when pasted elsewhere. The text appears correct in the app but becomes mojibake after copy-paste.

Example: "复制我的输出粘贴到别处 变乱码" becomes "澶嶅埗鎴戠殑杈撳嚭绮樿创鍒板埆澶?鍙樹贡鐮?"

This is UTF-8 bytes being decoded as GBK (CP936) -- a classic double-encoding symptom.

Environment

  • Claude Code: v2.1.92
  • OS: Windows 11 Pro 10.0.26200
  • System ANSI code page: 936 (GBK)
  • Console code page: 65001 (UTF-8)
  • Shell: PowerShell 7
  • System locale: zh_CN (Beta UTF-8 option DISABLED -- required for trading software compatibility)

Reproduction

  1. Run Claude Code desktop app on Windows with zh_CN locale (CP936)
  2. Get any Chinese text output from Claude
  3. Select and copy the text (Ctrl+C)
  4. Paste into any other application (Notepad, browser, etc.)
  5. Result: garbled text (UTF-8 bytes misinterpreted as GBK)

Expected behavior

Copied text should paste as readable Chinese, as it did in previous versions.

Notes

  • Cannot enable system-wide UTF-8 (breaks Chinese trading software that requires GBK)
  • This worked correctly before the v2.1.92 update
  • Text DISPLAYS correctly inside Claude Code -- only clipboard transfer is broken

View original on GitHub ↗

4 Comments

github-actions[bot] · 4 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/42417
  2. https://github.com/anthropics/claude-code/issues/44118
  3. https://github.com/anthropics/claude-code/issues/42482

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

2233admin · 4 months ago

Root cause analysis

The issue is in the clipboard write path. On Windows with non-UTF-8 system ANSI codepage (e.g. CP936/GBK for Chinese locale), Claude Code appears to write UTF-8 encoded bytes to CF_TEXT (ANSI clipboard format). Windows then auto-synthesizes CF_UNICODETEXT by decoding CF_TEXT using the system ANSI codepage (GBK), producing mojibake.

Evidence: Reading CF_TEXT raw bytes from clipboard after a copy operation returns valid UTF-8 that decodes correctly. But CF_UNICODETEXT (what applications read when pasting) contains garbled text — the UTF-8 bytes misinterpreted as GBK.

Suggested fix

Use clipboard.writeText(text) which writes directly to CF_UNICODETEXT, bypassing the CF_TEXT -> system codepage conversion path. Or ensure any native clipboard write uses the Unicode API (SetClipboardData(CF_UNICODETEXT, ...)) instead of the ANSI API (SetClipboardData(CF_TEXT, ...)).

Workaround

A background script that monitors clipboard changes, reads CF_TEXT raw bytes, decodes as UTF-8, and rewrites as proper CF_UNICODETEXT: https://gist.github.com/placeholder — works perfectly, 0 false positives.

ashwin-ant collaborator · 4 months ago

This was fixed in v2.1.97 — Clipboard copy on Windows now uses PowerShell Set-Clipboard with UTF-8, fixing garbled Chinese (and other non-ASCII) text. If you're still seeing this in the latest version, please comment with your version and repro and we'll reopen.

github-actions[bot] · 4 months ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.