[BUG] /copy command corrupts UTF-8 characters on Windows again (regression from #22346)
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
The /copy command corrupts all non-ASCII characters (Japanese/CJK) when copying to the Windows clipboard. The response.md file contains correct UTF-8 text, but the clipboard content is garbled (mojibake).
Example clipboard output:
���m�������܂����B
�ł́A���L�̓���猟�������iTRANSFER_CD LIKE ''�j���폜�������܂��B
What Should Happen?
Japanese text should be correctly copied to the clipboard, as it was in v2.1.70–v2.1.75.
Error Messages/Logs
(No error messages — the command reports success but the clipboard content is corrupted)
Steps to Reproduce
- Run Claude Code on Windows with a non-English locale (e.g., Japanese)
- Get a response containing Japanese characters
- Run /copy
- Paste from clipboard — Japanese characters are garbled
- Open the response.md file written by /copy — content is correct UTF-8
Claude Model
Opus
Is this a regression?
Yes, this worked in a previous version
Last Working Version
Last Working Version: 2.1.75 (confirmed working in #22346 comments)
Claude Code Version
2.1.88
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
Windows Terminal
Additional Information
This is a regression of #22346, which was fixed in v2.1.70 by switching to PowerShell's Set-Clipboard.
Environment details:
- Windows 11 Pro (10.0.26200)
- Shell: Git Bash
- PowerShell [Console]::OutputEncoding.CodePage: 932 (Shift_JIS)
- $LANG: ja_JP.UTF-8
Workaround:
powershell -Command "Get-Content '$env:TEMP\claude\response.md' -Encoding UTF8 -Raw | Set-Clipboard"
3 Comments
Still broken on v2.1.92. This regression was filed March 31 — five releases later, nothing. The UTF-8 to CP1252 corruption on clipboard paste is the primary communication channel between Claude Code agent windows. Multi-agent orchestration on Windows is broken because of this. Copying results from one agent to paste into another — the most basic workflow — destroys every table, every formatted output, every special character in transit.
Confirmed fixed on v2.1.104 (Windows 11 Pro, Git Bash, Japanese locale).
/copy now correctly preserves Japanese/CJK characters on the clipboard. The regression appears to have been resolved somewhere between v2.1.92 and v2.1.104.
Closing this issue. Thanks!
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.