Pasting Thai/multibyte UTF-8 into prompt input strips bytes 0x80–0x9F (mojibake, unrecoverable)
Summary
Pasting Thai (or any multibyte UTF-8 text containing bytes in the C1 control range 0x80–0x9F) into the Claude Code prompt input silently strips those bytes, producing mojibake. Because the bytes are dropped (not merely re-encoded), the original text is unrecoverable.
Typing the same Thai text directly via IME works perfectly — the corruption happens only on paste.
Environment
- Claude Code: 2.1.195 (native install,
~/.local/bin/claude) - OS: macOS (Darwin 25.5.0)
- Terminal: VS Code integrated terminal (
TERM_PROGRAM=vscode,TERM=xterm-256color) - Locale:
LANG=C.UTF-8
Steps to Reproduce
- Have any Thai text rendered in the terminal, e.g.
ทดสอบภาษาไทย 123 - Select it and copy
- Paste it into the Claude Code prompt input box
Expected
Pasted text matches the source: ทดสอบภาษาไทย 123
Actual
Mojibake with characters dropped, e.g. à¸à¸à¸ªà¸à¸à¸ าษาà¹à¸à¸¢ 123
The text is interpreted as Latin-1 AND the C1 control bytes (0x80–0x9F) — which occur frequently in Thai UTF-8 sequences (e.g. ท = E0 B8 97, where 0x97 is a C1 control) — are stripped. Round-trip recovery via .encode('latin-1').decode('utf-8') fails because the bytes are gone, not preserved.
Impact
Any user working in Thai (and likely other scripts whose UTF-8 second/third bytes land in 0x80–0x9F, e.g. many CJK/Cyrillic/Arabic ranges) cannot paste text into the prompt without irreversible corruption. Reported by the user as a regression that appeared after upgrading to a recent version.
Notes
- Pasting into a VS Code editor file (UTF-8) is clean — confirms the issue is in Claude Code's input/paste handling, not the OS clipboard or terminal.
- Likely a paste-path filter that drops control characters without preserving multibyte UTF-8 sequences (bracketed-paste sanitization treating raw bytes individually instead of decoding UTF-8 first).
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗