Edit tool replaces Turkish UTF-8 characters with ASCII equivalents

Resolved 💬 11 comments Opened Dec 14, 2025 by morphaven Closed Mar 7, 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 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:

  1. Adding new content that contains Turkish characters
  2. 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:

  1. Reading files with Turkish content
  2. Editing files that contain Turkish characters
  3. 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

  1. Create a file with Turkish content:

``typescript
// test.ts
const message = 'Merhaba dünya! Türkçe karakterler: şğüöçı'
``

  1. 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"
``

  1. 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:

  1. Character encoding during file read/write operations
  2. Internal string normalization that converts to ASCII
  3. 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

View original on GitHub ↗

This issue has 11 comments on GitHub. Read the full discussion on GitHub ↗