claude-code - 💡(How to fix) Fix C:/Program Files/Git/copy command garbles Japanese (UTF-8) text on Windows clipboard [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#45007Fetched 2026-04-09 08:15:33
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
0
Timeline (top)
labeled ×4commented ×1

Error Message

Error Messages/Logs

N/A — No error is displayed. The command appears to succeed, but the clipboard content is encoding-corrupted.

Root Cause

This is likely caused by the clipboard utility (e.g., clip.exe or the underlying Node.js clipboard library) not correctly handling UTF-8 encoded text on Windows. clip.exe interprets piped input using the system's default code page (CP932/Shift-JIS on Japanese Windows) rather than UTF-8.

RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched the existing issues to make sure this bug has not been reported yet
  • I am filing a single bug report (not multiple in one issue)
  • I am using the latest version of Claude Code

What's Wrong?

When using the /copy command to copy a response containing Japanese (or other non-ASCII/UTF-8) text to the clipboard on Windows, the copied text becomes garbled (文字化け/mojibake). Pasting the clipboard content into another session or application results in unreadable characters.

Manually selecting and copying the same text from the terminal works correctly.

What Should Happen?

The /copy command should correctly copy UTF-8 text (including Japanese, Chinese, Korean, and other non-ASCII characters) to the Windows clipboard without encoding corruption.

Steps to Reproduce

  1. Run Claude Code on Windows with PowerShell 7
  2. Ask Claude a question that produces a response containing Japanese text (e.g., 日本語で挨拶して)
  3. Use the /copy command to copy the response
  4. Paste the clipboard content into another application or session (e.g., Notepad, another terminal)
  5. Observe that the Japanese characters are garbled

Is this a regression?

Unknown

Claude Code Version

2.1.94

Platform

Anthropic

Operating System

Windows

Terminal/Shell

PowerShell 7.6.0 (Windows Terminal)

Error Messages/Logs

N/A — No error is displayed. The command appears to succeed, but the clipboard content is encoding-corrupted.

Claude Model

No response

Last Working Version

No response

Additional Information

This is likely caused by the clipboard utility (e.g., clip.exe or the underlying Node.js clipboard library) not correctly handling UTF-8 encoded text on Windows. clip.exe interprets piped input using the system's default code page (CP932/Shift-JIS on Japanese Windows) rather than UTF-8.

extent analysis

TL;DR

The /copy command's issue with garbled non-ASCII text on Windows can likely be resolved by ensuring the clipboard utility correctly handles UTF-8 encoded text.

Guidance

  • Investigate the Node.js clipboard library used by Claude Code to see if it has options for specifying the encoding of the text being copied to the clipboard.
  • Consider using a different clipboard utility that explicitly supports UTF-8, such as one that uses the Windows API directly to set the clipboard content with the correct encoding.
  • Verify that the issue persists when using a different terminal or shell on Windows to isolate if the problem is specific to PowerShell 7.
  • Check for any existing issues or pull requests in the clipboard library or Claude Code repositories related to encoding issues on Windows.

Example

No specific code example can be provided without knowing the details of the clipboard library used by Claude Code. However, the solution might involve setting an encoding option when copying text to the clipboard, similar to how file encoding is specified in other contexts.

Notes

The exact solution depends on the specifics of the clipboard library and its interaction with the Windows clipboard. The issue might be resolved by updating the library or Claude Code to handle UTF-8 encoding correctly.

Recommendation

Apply a workaround by using a different method to copy text to the clipboard that explicitly supports UTF-8 encoding, as the root cause seems related to the clipboard utility's handling of non-ASCII text.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING