[Windows] Clipboard copy produces garbled Chinese text after v2.1.92 update
Status Fixed / completed
Maintainer reply ✓ Yes — ashwin-ant
Workaround ✓ Mentioned in thread ↓
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
- Run Claude Code desktop app on Windows with zh_CN locale (CP936)
- Get any Chinese text output from Claude
- Select and copy the text (Ctrl+C)
- Paste into any other application (Notepad, browser, etc.)
- 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
4 Comments
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
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-synthesizesCF_UNICODETEXTby decodingCF_TEXTusing the system ANSI codepage (GBK), producing mojibake.Evidence: Reading
CF_TEXTraw bytes from clipboard after a copy operation returns valid UTF-8 that decodes correctly. ButCF_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 toCF_UNICODETEXT, bypassing theCF_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_TEXTraw bytes, decodes as UTF-8, and rewrites as properCF_UNICODETEXT: https://gist.github.com/placeholder — works perfectly, 0 false positives.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.
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.