C:/Program Files/Git/copy command corrupts UTF-8 characters on Windows
Resolved 💬 6 comments Opened Feb 1, 2026 by LicuVas 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.
This issue has 6 comments on GitHub. Read the full discussion on GitHub ↗