
What happened
In testing Claude Code 2.1.322, Read returned the CP932 Japanese CSV with every Japanese character replaced by U+FFFD and a "not valid UTF-8" warning, while Edit and Write refused the file and left its contents unchanged.
Why it matters
Refusing to write means the tool avoids silently replacing unreadable bytes with U+FFFD, but it also leaves the file unusable in the assistant until the encoding is handled outside it.
Summaries like this, every morning.
By signing up you agree to the Terms of Service and Privacy Policy.
The test compared four small CSV files — one CP932 with a special character (㈱), one Shift_JIS-safe, one UTF-8 without BOM, and one UTF-8 with BOM — across Claude Code's Read, Edit, and Write tools plus pandas and iconv. pandas failed to read the CP932 file as UTF-8 with a UnicodeDecodeError, succeeded with encoding="cp932", but failed with encoding="shift_jis" at position 32 because ㈱ (U+3231) exists in CP932 but not in standard Shift_JIS. iconv showed the same split: -f CP932 succeeded, -f SHIFT_JIS failed.
Read returned the CP932 file without error but with Japanese characters replaced by U+FFFD and a warning that Edit and Write would refuse it; the UTF-8 files displayed correctly. Edit then refused the file, with the before and after copies sharing the same hash, and Write refused for both a one-line 'hello' and a two-line Japanese replacement. The refusal messages say the tools write UTF-8 and never convert encodings on their own, suggesting a shell command that keeps the original encoding.
The results partly match the official Tools reference, which says Read shows undecodable bytes as U+FFFD and Edit refuses non-UTF-8 files — the test saw both. Write, however, behaved differently from the documentation's claim that it can replace such a file if the new content has no U+FFFD. The open issue anthropics/claude-code#7134, filed in 2025-09 for a Windows-1252 file, reported that Read displayed correctly while Edit and Write corrupted the file by writing UTF-8; later comments reported Read returning U+FFFD (2026-07) and Edit switching to refusal in 2.1.296 (2026-10-11), with Write not refusing in that version. The test's Read and Edit results match those comments, though it did not try a Windows-1252 file.
Pick your industry and the AI tools you use, and get news related to your work every day.
By signing up you agree to the Terms of Service and Privacy Policy.
Free · 30 seconds with Google · unsubscribe anytimeWhat is AIToday? →
Ask AI anything about this article. The AI reads this article, earlier AIToday articles, and Wikipedia, and cites its sources. Q&As are published on this page for other readers too.
At re:Invent 2026, AWS announced Project Code Confidence, which pairs LLMs with the Lean theorem prover to wri…
The developer says coding is handed to worker AI agents, while the human moves cards on the kanban and answers…

Across 10 apps built with Claude Code (Sonnet 5.5), adding a single security instruction changed nothing in th…

A practitioner describes using Claude, Codex, Kiro and several other AI tools side by side, choosing which too…

A developer switched from one session handling sites in sequence to one Claude Code subagent per site from Oct…

The author found 'Solve Vision with Code' (arXiv:2611.34813) and re-ran its comparison of video generation vs
