/copy command produces garbled accented characters on Windows (UTF-8 vs CP437)
Summary
The /copy command on Windows puts garbled text in the clipboard when the response contains accented characters (é, è, ç, ô, etc.). The UTF-8 bytes are interpreted as CP437.
Steps to reproduce
- Open cmd.exe with code page 65001 (
chcp 65001) - Launch Claude Code
- Get a response containing accented characters (e.g.
éèêë àâ ùû ïî ç ô) - Run
/copy - Paste in any application
Expected
éèêë àâ ùû ïî ç ô — Été, François, Québec, Noël, naïve, résumé.
Actual
éèêë àâ ùû ïî ç ô — Été, François, Québec, Noël, naïve, résumé.
Root cause
/copy passes UTF-8 bytes to the clipboard via a subprocess that uses CP437 (Windows default code page). For example, é is UTF-8 C3 A9, which CP437 renders as ├⌐ (C3=├, A9=⌐).
The file written to C:\Users\...\AppData\Local\Temp\claude\response.md is correct UTF-8. Only the clipboard path is affected.
Workaround
After /copy, re-read the file with explicit UTF-8 encoding:
powershell.exe -Command "Get-Content 'C:\Users\<user>\AppData\Local\Temp\claude\response.md' -Encoding UTF8 | Set-Clipboard"
Environment
- Windows 11 Home 10.0.26200
- Terminal: cmd.exe with code page 65001 (chcp 65001)
LANG=en_US.UTF-8,LC_ALL=en_US.UTF-8set in Claude Code settings.json env- Registry
HKCU:\Console\CodePage= 65001 andHKCU:\Software\Microsoft\Command Processor\AutoRun=chcp 65001 >nul— neither affects/copysubprocess
🤖 Generated with Claude Code
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗