[BUG] Edit Tool Unicode-to-ASCII Mojibake Corruption on Windows (.md files)

Resolved 💬 7 comments Opened Feb 28, 2026 by Fred-ian Closed Jun 14, 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?

Claude Code Version: 2.1.63
Claude Model: claude-opus-4-6 (Opus)
Platform: Anthropic API
OS: Windows 11 Pro 10.0.26200
Terminal: Windows Terminal / Bash + PowerShell 7.5.4

Claude Code's Edit tool introduced Unicode corruption into .md files over a period of at least 12 days (Feb 16-28, 2026). Anthropic reportedly shipped a fix on Feb 25-26, but files corrupted before the fix still contain destroyed content, and Claude's own validation tools cannot detect this corruption class.

The corruption converts Unicode box-drawing characters to ASCII mojibake. For example:

| Original Unicode | Corrupted Result | Unicode Codepoint |
|---|---|---|
| (top-left corner) | "OE" | U+250C |
| (left T-junction) | "oe" | U+251C |
| (vertical line) | "'" | U+2502 |
| (bottom-left corner) | """ | U+2514 |
| (right arrow) | "-¶" | U+2192 |
| (right T-junction) | "¼" | U+2524 |
| (top-right corner) | "¬" | U+2510 |

This is a Windows-1252 (CP1252) encoding interpretation of UTF-8 multi-byte sequences -- each UTF-8 byte was interpreted as a separate CP1252 character.

Detection Gap

The critical issue is that the corruption is invisible to standard validation:

  1. The corrupted output IS valid ASCII text (quotes, letters like "OE", "oe", fraction symbols)
  2. Claude-generated encoding validation scripts scan for non-ASCII characters -- but the corruption REPLACED Unicode WITH ASCII
  3. A nightly scheduled validation task (12:30 AM daily) runs the validation script and reports PASS on actively corrupted files
  4. The original content is irrecoverably destroyed in the corrupted files unless backups exist
Live Example (as of Feb 28, 2026)

File: C:\Users\ndwar\ai-local\docs\SYSTEM-ARCHITECTURE-OVERVIEW.md

91 lines of mojibake box-drawing corruption. The file contains architectural diagrams that originally used Unicode box-drawing characters. Every diagram in the file is now unreadable.

Example from the file (lines 55-67):

"OE""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"'                    LOCAL-FIRST AI STACK                         "'
"oe""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"'  Applications    "' Claude Code "' Gemini CLI "' Outline "' Custom "'
"oe"""""""""""""""""""~""""""""""""""'"""""""""""""'"""""""""""""'"""""""""

This was originally a properly rendered table using Unicode box-drawing characters.

Scale
  • Hundreds of cleanup attempts were made across sessions over 12 days
  • A single-run encoding fix found 85 corruptions in agent files alone -- this understates the total scope across all .md files
  • I deliberately consolidated all AI work under Claude Code ($200/month commitment) to ensure single-tool attribution, making corruption traceable to Claude exclusively

What Should Happen?

  1. The Edit tool should never convert UTF-8 Unicode characters to CP1252 mojibake
  2. Files corrupted before the fix should be identifiable -- Anthropic should provide guidance or a tool for detecting already-corrupted files
  3. The corruption pattern (Unicode box-drawing to ASCII mojibake) should be documented so users can scan their own files

Error Messages/Logs

No error messages are generated. The corruption is silent -- the Edit tool returns success, and the file appears to write correctly. The mojibake is only visible when reading the file content.

Steps to Reproduce

  1. Create a .md file containing Unicode box-drawing characters (e.g., ┌──┐)
  2. Use Claude Code's Edit tool to modify a DIFFERENT part of the same file
  3. Observe whether the box-drawing characters are preserved or converted to ASCII mojibake

Note: This may no longer reproduce if the fix shipped Feb 25-26 is effective. The issue is that already-corrupted files persist and are undetectable by standard ASCII validation.

Is this a regression?

Yes -- files with Unicode content were not corrupted before ~Feb 16, 2026.

Additional Information

  • Related Issues: This is Issue 1 of 3. Issue 2 (Cross-Drive Scope Blindness) and Issue 3 (Cross-Session Compounding Degradation) will be filed separately and cross-linked.
  • Full conversation transcripts saved as evidence at F:\Claude Training Development Request\
  • User-saved PDF backups of original documents exist as evidence of pre-corruption state

View original on GitHub ↗

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