
What happened
The write-up reproduces six traps on Windows 11 with Windows PowerShell 5.1 at code page 932 and Python 3.13, including piping Japanese into 'claude -p' arriving as '??' and a BOM-less .ps1 that exits 0 with wrong characters.
Why it matters
The failures pass with exit code 0 and only the output is wrong in four of the six cases, so the author says to verify with hex dumps and comparison results rather than what the screen shows.
Summaries like this, every morning.
By signing up you agree to the Terms of Service and Privacy Policy.
That makes them hard to catch by eye, and the author notes that terminal settings can mask them further — setting the code page to 65001 or running PowerShell 7 changes which traps reproduce, so a script that works interactively can still fail when launched from a scheduler or another program. Two of the traps are about the two directions of a pipe: PowerShell 5.1 encodes text sent to an external command using $OutputEncoding, which defaults to ASCII, while it reads that command's output using [Console]::OutputEncoding, which defaults to cp932. Fixing only one direction leaves the other broken. A third trap appears only on redirection, where Python tries to write cp932 to a file and crashes on characters like em dashes that AI-generated text often contains. A fourth shows that Python's -I isolated mode ignores the PYTHONIOENCODING workaround, so the script itself must reconfigure its output. The last two are file-format traps: a .ps1 saved as UTF-8 without a BOM is read as cp932 by PowerShell 5.1, and a .cmd file with LF line endings and cp932 encoding can cause cmd.exe to execute parts of comment lines. The author cites a report in the anthropics/claude-code repository (#92328) where an LF .cmd file turned 'del /F /Q "%VAR%"' into 'del /F /Q ""' and deleted files in the working folder, though the author did not reproduce that deletion. The piece closes by pointing to a free GitHub reproduction script and a Zenn book covering 14 total traps.
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
