UTF-8 surrogate encoding error on Windows with non-ASCII (Korean) directory paths
Bug Description
When running Claude Code in a directory containing Korean (non-ASCII) characters in the path, a persistent error message appears:
Claude | Error: 'utf-8' codec can't encode character '\udcec' in position 31: surrogates not allowed
This error message overlays the status bar, making it unreadable.
Environment
- OS: Windows 11 Pro
- Platform: win32
- Shell: bash (Git Bash)
- Claude Code model: claude-opus-4-6
Steps to Reproduce
- Navigate to a directory with Korean characters in the path (e.g.,
D:\01_총무,재무) - Launch Claude Code (
claude) - The error message appears and covers the status line
Expected Behavior
Claude Code should handle non-ASCII (Korean, Japanese, Chinese, etc.) directory paths without encoding errors on Windows.
Analysis
The surrogate character \udcec (0xec is a leading byte for Korean UTF-8 sequences) suggests that somewhere in the codebase, a file path is being decoded with the surrogateescape error handler (common on Windows/Python) and then re-encoded with strict UTF-8, which rejects surrogate characters.
The fix would likely involve using surrogatepass or properly handling the encoding roundtrip for Windows paths containing non-ASCII characters.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗