claude-code - 💡(How to fix) Fix [Bug] Windows UTF-8 encoding corruption with non-ASCII characters in file writes [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#52761Fetched 2026-04-24 10:40:14
View on GitHub
Comments
1
Participants
2
Timeline
4
Reactions
0
Timeline (top)
labeled ×3commented ×1

Code Example

[]
RAW_BUFFERClick to expand / collapse

Bug Description Claude Code writes .md files with corrupted UTF-8 encoding on Windows when content contains French accents. Written file shows mojibake (é, è, §) instead of proper characters. This breaks downstream subagent invocations with ECONNRESET on the API call.

Environment Info

  • Platform: win32
  • Terminal: windows-terminal
  • Version: 2.1.119
  • Feedback ID: 125e013c-2746-4ed1-b9db-cb4cb67d0ed1

Errors

[]

extent analysis

TL;DR

The issue can likely be resolved by ensuring the correct UTF-8 encoding is used when writing .md files on Windows.

Guidance

  • Verify that the code writing the .md files is set to use UTF-8 encoding, as the default encoding on Windows may not be UTF-8.
  • Check the documentation of the Claude Code tool to see if there are any options or settings to specify the encoding of output files.
  • Test writing a simple .md file with French accents using the Claude Code tool to see if the issue is reproducible and isolate the problem.
  • Consider using a hex editor to inspect the written .md file and verify its encoding.

Example

No code snippet can be provided without more context about the Claude Code tool, but ensuring UTF-8 encoding in file writing operations typically involves setting the encoding explicitly, e.g., encoding='utf-8' in Python.

Notes

The solution may depend on the specifics of the Claude Code tool and its configuration options. If the tool does not support setting the encoding, alternative tools or workarounds may be necessary.

Recommendation

Apply workaround: Ensure UTF-8 encoding is used when writing .md files, as this is likely to resolve the mojibake issue and prevent downstream errors.

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