[BUG] VS Code extension chat panel misidentifies valid UTF-8 Japanese text attachments as garbled/corrupted
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
When attaching a Japanese-language text file (verified UTF-8, no BOM, LF line endings, NFC-normalized) to the central-pane chat tab of the Claude Code VS Code extension, Claude frequently responds with something to the effect of "this attachment appears to be garbled/corrupted, so I'll read the original file directly instead" — even though the file is verified to be completely clean.
This does not happen when using Claude Code via the integrated terminal with the same file, same environment, same session. It appears specific to the extension's chat panel attachment-handling path, not the terminal interface.
What Should Happen?
The chat panel should read and pass through the attached file's content without misreporting a valid, cleanly-encoded UTF-8 Japanese text file as garbled.
Error Messages/Logs
(No error dialog or console error — Claude's own chat response incorrectly claims the attachment is garbled. See screenshot in Additional Information.)
Steps to Reproduce
- Prepare a clean Japanese-language
.mdfile, confirmed to be:
- UTF-8 encoded, no BOM
- LF line endings only
- NFC-normalized (verified via Python:
unicodedata.normalize('NFC', text) == text)
- Open the Claude Code extension's central-pane chat tab in VS Code (claudeCode.preferredLocation: panel) — not the integrated terminal
- Attach the file to a message
- Observe Claude's response — with some frequency, it claims the attachment is garbled and offers to re-read the file from disk instead
Note: The same file works with no issue when using Claude Code through the integrated terminal instead of the chat panel.
Additional verification performed to rule out environmental causes:
- Confirmed
chcp 65001, PowerShell profile UTF-8 output encoding, and VS Code'sfiles.encoding/terminal.integrated.env.windowsLANG settings are all correctly set to UTF-8 — the misidentification still occurs with these in place - This rules out BOM issues, NFC/NFD normalization mismatches, and terminal/locale/codepage misconfiguration as the cause
Claude Model
None
Is this a regression?
No
Last Working Version
None
Claude Code Version
2.1.199 (Claude Code)
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
PowerShell
Additional Information
This suggests the chat panel may be handling attachment ingestion through a different code path than the terminal interface (e.g., a different encoding assumption during file read/transport), independent of OS-level or VS Code-level encoding settings.
Screenshot attached showing Claude's response claiming the attached spec file was garbled, despite the file being verified clean.
<img width="1198" height="635" alt="Image" src="https://github.com/user-attachments/assets/a8a83237-8804-4b6e-bbb9-5969802ba63a" />
Note: I was using Claude Code 2.1.199 when I reported this. It appears that version 2.1.207 has since been released; if the same issue recurs with the latest version, I will add an update here.