C:/Program Files/Git/copy command corrupts UTF-8 characters on Windows
Status Closed — not planned
Maintainer reply None cached
Workaround ✓ Mentioned in thread ↓
Activity 7 comments · opened Feb 1, 2026 · closed May 11, 2026
Description
The /copy command in Claude Code corrupts UTF-8 characters when copying to Windows clipboard.
Environment
- OS: Windows 10/11
- Terminal: Windows Terminal / PowerShell
- Claude Code version: latest
Steps to Reproduce
- Have Claude generate text with non-ASCII characters (e.g., Romanian diacritics: ă, ț, ș, î, â)
- Include box-drawing characters (├, └, │, ─) in the output
- Use
/copyto copy the message - Paste into any text editor
Expected Behavior
Characters should be preserved exactly as displayed in the terminal.
Actual Behavior
Characters are corrupted (mojibake):
ă→─âț→╚Ťș→╚Ö├──→ÔöťÔöÇÔöÇ└──→ÔööÔöÇÔöÇ
Example
Original (in terminal):
Excelentă observație
├── Item 1
└── Item 2
After /copy + paste:
Excelent─â observa╚Ťie
ÔöťÔöÇÔöÇ Item 1
ÔööÔöÇÔöÇ Item 2
Root Cause
Windows clipboard uses different encoding (CP-1252 or UTF-16) than UTF-8 used in the terminal. The /copy command likely doesn't explicitly encode as UTF-8 when writing to clipboard.
Suggested Fix
Use explicit UTF-8 encoding when copying to clipboard on Windows, possibly via pyperclip with proper encoding or Windows API with CF_UNICODETEXT format.
7 Comments
I'm experiencing the same issue on a Japanese Windows environment.
Environment:
Reproduction:
/copyResult:
Japanese text like
これは v2.1.63 で追加されたbecomes garbled as縺薙l縺ッ v2.1.63 縺ァ霑ス蜉縺輔l縺・. This is the classic pattern of UTF-8 bytes being interpreted as Shift-JIS (CP932).Analysis:
The
/copycommand appears to write raw UTF-8 bytes to the Windows clipboard as CF_TEXT (ANSI), rather than using CF_UNICODETEXT (UTF-16). Since the system ANSI codepage on Japanese Windows is CP932, the UTF-8 bytes get misinterpreted.This affects all non-ASCII characters — not just Romanian diacritics as originally reported, but also CJK characters, box-drawing characters, and any multibyte UTF-8 sequences.
Workaround:
Manual text selection in the terminal (e.g., WezTerm mouse select → auto-copy) preserves encoding correctly.
This appears to be fixed in v2.1.70. The release notes state:
I can confirm that
/copywith Japanese text works correctly on v2.1.75 (Windows 11 + WezTerm + WSL). The issue can likely be closed.Still present in 2.1.89 (Claude Code)
Windows 11
Windows Terminal
_not_ WSL
Same issue french language
w11 - Gitbash - MinTTY
Closing for now — inactive for too long. Please open a new issue if this is still relevant.
Environment: Windows 11 Pro, PowerShell, Italian locale
Reproduction: Use
/copyon any response containing Italian accented characters (à, è, ù, ò, ì). The clipboard content shows garbled sequences:à→Ã,è→è,ù→ù.Workaround:
Set-Clipboardvia PowerShell produces correct UTF-8 output for the same text.Example output from
/copy:separazione delle responsabilità , coerenza, manutenibilitÃ
Expected:
separazione delle responsabilità, coerenza, manutenibilità
Root cause appears to be UTF-8 content written to clipboard using CP437/CP1252 encoding on Windows.
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.