/copy command produces garbled accented characters on Windows (UTF-8 vs CP437)

Resolved 💬 3 comments Opened Apr 7, 2026 by smojef Closed Apr 11, 2026

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

  1. Open cmd.exe with code page 65001 (chcp 65001)
  2. Launch Claude Code
  3. Get a response containing accented characters (e.g. éèêë àâ ùû ïî ç ô)
  4. Run /copy
  5. 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-8 set in Claude Code settings.json env
  • Registry HKCU:\Console\CodePage = 65001 and HKCU:\Software\Microsoft\Command Processor\AutoRun = chcp 65001 >nul — neither affects /copy subprocess

🤖 Generated with Claude Code

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗