[BUG] Claude Code corrupts accented characters (ISO-8859-1 encoding issue)

Status Closed — not planned
Maintainer reply None cached
Activity 15 comments · opened Oct 31, 2025 · closed May 10, 2026

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 Claude Code edits files containing accented Portuguese characters (such as ç, ã, é, í, etc.), it corrupts them, replacing those characters with strange symbols like “�”.
This happens even when the file is saved in ISO-8859-1 encoding.

Example:

//Centraliza o botão dentro do panel

becomes:

//Centraliza o bot�o dentro do panel

The problem affects the entire file — not only the modified sections.

<img width="331" height="27" alt="Image" src="https://github.com/user-attachments/assets/25cb8f6b-eaf1-4f96-91d6-c144e1e6e01e" />

What Should Happen?

Claude Code should preserve ISO-8859-1 encoding and keep all accented characters intact after editing the file.

Error Messages/Logs

Steps to Reproduce

Create a file test.pas (or .py, .js, etc.) with the following content:

//Centraliza o botão dentro do panel
procedure Teste();
begin
ShowMessage('Ação executada com sucesso!');
end;

Run any Claude Code command that modifies the file, for example:

claude "add explanatory comments to the code"

Check the result in your editor — accented characters appear corrupted like “�”.

Claude Model

Sonnet (default)

Is this a regression?

No, this never worked

Last Working Version

_No response_

Claude Code Version

2.0.28

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

PowerShell

Additional Information

_No response_

View original on GitHub ↗

15 Comments

github-actions[bot] · 10 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/7335
  2. https://github.com/anthropics/claude-code/issues/7134
  3. https://github.com/anthropics/claude-code/issues/3416

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

lucas3g · 10 months ago

👎

EmberNed · 9 months ago

👎
Can't believe they just don't care about this serious issue.

lucas3g · 9 months ago

👎

lucas3g · 9 months ago

Anyone?

cmacetko · 9 months ago

Has anyone managed to solve this?

VoronkovIvan · 8 months ago

👎

github-actions[bot] · 7 months ago

This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.

lucas3g · 7 months ago

👎

haksanlulz · 6 months ago

I am currently getting this with anything i upload, specifically em dashes, arrows and ü.

lucas3g · 6 months ago

I solved this problem by asking it to generate a PowerShell script with the encoding I wanted, and then it stopped crashing.

dimitar-grigorov · 5 months ago

Had the same problem with Delphi projects - Windows-1251 files getting destroyed on every edit.

I ended up building an MCP server that auto-detects file encoding and preserves it when reading/writing. Works as a drop-in replacement for the built-in file tools in Claude Code.

https://github.com/dimitar-grigorov/mcp-file-tools

Not a fix for the core issue obviously, but it stops the corruption until this gets addressed properly.

MichaelCharles · 5 months ago

I was having the same issue as @dimitar-grigorov, but in my case we're working in Japanese with Shift JIS / CP932 encoded files. I also ended up making an MCP server to replace the native Read/Edit/Grep/Write tools. You can find it here

https://github.com/MichaelCharles/cp932-tools-mcp-server

It's been working great for me so far.

github-actions[bot] · 3 months ago

Closing for now — inactive for too long. Please open a new issue if this is still relevant.

github-actions[bot] · 2 months ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.