Skip to content

Windows TUI paste loses Turkish characters (CP857 vs UTF-8) #6385

Closed as duplicate

Description

@cehnzz

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

  1. Run codex to open TUI.
  2. Copy Turkish text like: çğıöşü ÇĞİÖŞÜ ... (or a real paragraph with diacritics).
  3. 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 ReadConsoleA vs ReadConsoleW.
  • 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!

Activity

  1. added
    bug
    CLI
    windows-os
    TUI
    on Nov 8, 2025
  2. github-actions commented on Nov 8, 2025

    @github-actions
    Contributor

    Potential duplicates detected. Please review them and close your issue if it is a duplicate.

    Powered by Codex Action

  3. etraut-openai commented on Nov 8, 2025

    @etraut-openai
    Contributor

    Thanks for reporting. I think this is a duplicate of #5684.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    CLITUIbugwindows-os

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions