Edit tool replaces Turkish UTF-8 characters with ASCII equivalents
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 using the Edit tool to modify files containing Turkish UTF-8 characters, Claude Code systematically replaces Turkish special characters with their ASCII equivalents:
- ş → s
- ı → i
- ğ → g
- ü → u
- ö → o
- ç → c
- Ş → S
- İ → I
- Ğ → G
- Ü → U
- Ö → O
- Ç → C
This happens both when:
- Adding new content that contains Turkish characters
- When the edit touches existing Turkish text in the file
The corruption occurs silently without any warning, causing data loss and requiring manual fixes.
What Should Happen?
Claude Code should preserve all UTF-8 characters exactly as they appear in the source content. Turkish characters (and other non-ASCII Unicode characters) should remain unchanged when:
- Reading files with Turkish content
- Editing files that contain Turkish characters
- Writing new content that includes Turkish characters
The Edit tool should be encoding-aware and maintain byte-for-byte accuracy for all UTF-8 content.
Error Messages/Logs
Steps to Reproduce
- Create a file with Turkish content:
``typescript``
// test.ts
const message = 'Merhaba dünya! Türkçe karakterler: şğüöçı'
- Ask Claude to edit the file (e.g., "add a console.log statement"):
````
claude "Add a console.log to print the message in test.ts"
- After the edit, check the file content:
``typescript``
// Result - Turkish characters are corrupted:
const message = 'Merhaba dunya! Turkce karakterler: sguoci'
Real-world example from my session:
- Original file had:
'PWA (Progressive Web App) özellikleri kapsamlı şekilde geliştirildi' - After Claude's edit:
'PWA (Progressive Web App) ozellikleri kapsamli sekilde gelistirildi'
The issue is 100% reproducible with any file containing Turkish characters.
Claude Model
Opus
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.0.69 (Claude Code)
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
VS Code integrated terminal
Additional Information
Impact
This bug affects all non-English languages that use special UTF-8 characters, including but not limited to:
- Turkish (ş, ğ, ı, ü, ö, ç)
- German (ä, ö, ü, ß)
- French (é, è, ê, ë, à, ç)
- Spanish (ñ, á, é, í, ó, ú)
- Portuguese, Polish, Czech, and many others
Workaround
Currently, users must manually review and fix all edited files after each Claude Code operation, which is time-consuming and error-prone.
Hypothesis
The issue may be related to:
- Character encoding during file read/write operations
- Internal string normalization that converts to ASCII
- A tokenization or processing step that strips non-ASCII characters
Notes
- The bug is 100% reproducible
- Affects both the Edit and Write tools
- Happens regardless of file type (.ts, .tsx, .js, .json, .md, etc.)
- File encoding is UTF-8 with proper BOM
This issue has 11 comments on GitHub. Read the full discussion on GitHub ↗