Windows TUI paste loses Turkish characters (CP857 vs UTF-8)
Resolved 💬 2 comments Opened Nov 8, 2025 by cehnzz Closed Nov 8, 2025
Summary
Codex CLI interactive TUI (chat) loses Turkish characters (ç, ğ, ı, İ, ö, ş, ü) when pasting from clipboard on Windows. Same text via stdin works fine.
Environment
- OS: Windows 11 Pro 64-bit, build 26220
- PowerShell: 7.6.0-preview.5
- Codex CLI: 0.56.0
- Console code page (initial): 857 (Turkish DOS)
- Tried:
chcp 65001,[Console]::InputEncoding/OutputEncoding = UTF8(no change in TUI) - Terminal: Windows Terminal/ConHost
Steps to Reproduce
- Run
codexto open TUI. - Copy Turkish text like:
çğıöşü ÇĞİÖŞÜ ...(or a real paragraph with diacritics). - Paste into TUI.
Expected
- Pasted text should preserve all Turkish characters.
Actual
- Some Turkish characters are missing/corrupted (especially ı/İ/ğ/ş/ç/ö/ü).
Control Test (stdin works)
Get-Clipboard -Raw | codex exec --skip-git-repo-check --color never -- Output preserves characters correctly.
Notes / Hypothesis
- TUI reads console input through ANSI code page (CP857) path and converts to UTF-8, dropping diacritics. Possibly falling back to
ReadConsoleAvsReadConsoleW. - Suggest ensuring Unicode path for input on Windows (ReadConsoleW/ConPTY UTF-16) or forcing UTF-8 via
SetConsoleCP/SetConsoleOutputCP(65001)at startup.
Workarounds
- Provide initial prompt as arg:
$p=Get-Clipboard -Raw; codex -- "$p" - Use stdin:
Get-Clipboard -Raw | codex exec --skip-git-repo-check - - Resume with stdin:
Get-Clipboard -Raw | codex exec resume --last -
Thanks!
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗