claude-code - 💡(How to fix) Fix [BUG] Cowork on Windows corrupts non-ASCII characters when syncing files from sandbox to host filesystem [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#46354Fetched 2026-04-11 06:22:30
View on GitHub
Comments
1
Participants
2
Timeline
4
Reactions
0
Author
Timeline (top)
labeled ×3commented ×1

When Cowork writes files containing non-ASCII characters (en dashes, em dashes, curly quotes, bullets, euro signs, etc.), the files appear correct inside the Cowork sandbox but are corrupted when synced to the Windows host filesystem. Multi-byte UTF-8 sequences are decoded as Windows-1252 single-byte characters, producing classic mojibake.

This causes silent data corruption for any workflow that reads Cowork output files from the host filesystem (e.g., sync agents, scripts, or the user opening files in external editors).

Error Message

Error Messages/Logs

Root Cause

The en dash (U+2013) is encoded as UTF-8 bytes E2 80 93. These three bytes are being interpreted as three Windows-1252 single-byte characters:

  • E2â
  • 80
  • 93"

This produces the Unicode string â€" (U+00E2, U+20AC, U+201C), which is then written to the file. The corruption is irreversible without knowing the original encoding.

This is the same class of bug as #29699 (Edit tool mojibake on Windows) and #31295 (Bash tool UTF-8 corruption on Windows), but occurring in a different layer — the mechanism that syncs files from Cowork's sandbox to the host filesystem.

Code Example

Write a file called encoding-test.txt to your outputs directory with this content:
   en dash:   em dash:   curly quotes: "hello" 'world'
   euro:   bullet:
---

en dash:em dash:curly quotes: "hello" 'world'
euro:bullet:
---

en dash: â€"
em dash: â€"
curly quotes: “hello†‘world’
euro: €
bullet: •

---

en dash:em dash:curly quotes: "hello" 'world'
euro:bullet:
---



---

Write a file called encoding-test.txt to your outputs directory with this content:
   en dash:   em dash:   curly quotes: "hello" 'world'
   euro:   bullet:
---

en dash:em dash:curly quotes: "hello" 'world'
euro:bullet:
---

en dash: â€"
em dash: â€"
curly quotes: “hello†‘world’
euro: €
bullet: •
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

Description

When Cowork writes files containing non-ASCII characters (en dashes, em dashes, curly quotes, bullets, euro signs, etc.), the files appear correct inside the Cowork sandbox but are corrupted when synced to the Windows host filesystem. Multi-byte UTF-8 sequences are decoded as Windows-1252 single-byte characters, producing classic mojibake.

This causes silent data corruption for any workflow that reads Cowork output files from the host filesystem (e.g., sync agents, scripts, or the user opening files in external editors).

Reproduction

  1. Open Cowork on Windows
  2. Ask Claude to write a file with special characters:
    Write a file called encoding-test.txt to your outputs directory with this content:
    en dash: –
    em dash: —
    curly quotes: "hello" 'world'
    euro: €
    bullet: •
  3. Claude reads the file back inside Cowork and reports all characters are correct
  4. Open the file from the Windows filesystem (e.g., via PowerShell Get-Content)

Expected behavior

File on disk contains valid UTF-8:

en dash: –
em dash: —
curly quotes: "hello" 'world'
euro: €
bullet: •

Actual behavior

File on disk contains mojibake — UTF-8 bytes decoded as Windows-1252:

en dash: â€"
em dash: â€"
curly quotes: “hello†‘world’
euro: €
bullet: •

Analysis

The en dash (U+2013) is encoded as UTF-8 bytes E2 80 93. These three bytes are being interpreted as three Windows-1252 single-byte characters:

  • E2â
  • 80
  • 93"

This produces the Unicode string â€" (U+00E2, U+20AC, U+201C), which is then written to the file. The corruption is irreversible without knowing the original encoding.

This is the same class of bug as #29699 (Edit tool mojibake on Windows) and #31295 (Bash tool UTF-8 corruption on Windows), but occurring in a different layer — the mechanism that syncs files from Cowork's sandbox to the host filesystem.

Impact

This is a data corruption bug, not just a display issue. Any external process that reads Cowork output files on Windows receives corrupted data.

Environment

  • OS: Windows 10 (Version 10.0.26200.8037)
  • Claude Desktop: Installed from standard installer (not Microsoft Store)
  • Plan: Max
  • Model: Opus 4.6

What Should Happen?

Expected behavior

File on disk contains valid UTF-8:

en dash: –
em dash: —
curly quotes: "hello" 'world'
euro: €
bullet: •

Error Messages/Logs

Steps to Reproduce

Reproduction

  1. Open Cowork on Windows
  2. Ask Claude to write a file with special characters:
    Write a file called encoding-test.txt to your outputs directory with this content:
    en dash: –
    em dash: —
    curly quotes: "hello" 'world'
    euro: €
    bullet: •
  3. Claude reads the file back inside Cowork and reports all characters are correct
  4. Open the file from the Windows filesystem (e.g., via PowerShell Get-Content)

Expected behavior

File on disk contains valid UTF-8:

en dash: –
em dash: —
curly quotes: "hello" 'world'
euro: €
bullet: •

Actual behavior

File on disk contains mojibake — UTF-8 bytes decoded as Windows-1252:

en dash: â€"
em dash: â€"
curly quotes: “hello†‘world’
euro: €
bullet: •

Claude Model

None

Is this a regression?

I don't know

Last Working Version

No response

Claude Code Version

Cowork

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

PowerShell

Additional Information

No response

extent analysis

TL;DR

The issue can be fixed by ensuring that the file syncing mechanism from Cowork's sandbox to the Windows host filesystem properly handles UTF-8 encoding.

Guidance

  • Verify that the syncing mechanism is set to use UTF-8 encoding when writing files to the Windows host filesystem.
  • Check if the issue is related to the Windows system's default encoding settings and consider setting the system to use UTF-8 as the default encoding.
  • Consider adding a step in the syncing process to explicitly convert UTF-8 bytes to the correct encoding for the Windows host filesystem.
  • Test the syncing mechanism with different encoding settings to identify the root cause of the issue.

Example

No specific code example can be provided without knowing the implementation details of the syncing mechanism. However, ensuring that file operations use the correct encoding (e.g., utf-8) when reading and writing files can help prevent mojibake issues.

Notes

The issue seems to be related to the syncing mechanism not properly handling UTF-8 encoding, which is a common cause of mojibake problems. The fact that the issue is similar to previously reported bugs (#29699 and #31295) suggests that it may be a systemic issue with the handling of encoding in the Cowork system.

Recommendation

Apply a workaround to ensure that the syncing mechanism properly handles UTF-8 encoding, such as explicitly setting the encoding when writing files to the Windows host filesystem. This can help prevent data corruption until a permanent fix is implemented.

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…

FAQ

Expected behavior

File on disk contains valid UTF-8:

en dash: –
em dash: —
curly quotes: "hello" 'world'
euro: €
bullet: •

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING