Chinese text sometimes garbled in Codex on Windows (WSL)
Description
Chinese text appears as garbled characters when running Orca commands (e.g., orca-ide computer get-app-state) in WSL on Windows. The output shows mojibake instead of the original Chinese characters.
Steps to Reproduce
- Run an Orca command in WSL that outputs Chinese text (e.g.,
orca-ide computer get-app-state --app Orca --window-id <id> --json) - Observe the output in the terminal
Expected Behavior
Chinese characters should display correctly.
Actual Behavior
Chinese characters are garbled/mojibake. Example output:
Environment
- OS: Windows with WSL (Ubuntu)
- Shell: CMD.EXE inside WSL
- Orca: latest
Context
Reported by user in WeChat group. The issue appears specific to Windows/WSL environments where non-ASCII (Chinese) characters are not being encoded/decoded properly between the Orca process and the terminal output.
Made with Orca 🐋
I'd like to work on this. I dug into the root cause: the CLI's own stdout is correct UTF-8 (src/cli/format.ts just does console.log(JSON.stringify(...))), so this isn't a CLI encoding bug. The mojibake comes from wsl.exe re-encoding a child process's output for the host console's active codepage unless WSL_UTF8=1 is set — this codebase already has that fix in one call site (src/main/agent-hooks/wsl-hook-relay-launch.ts) but two sibling wsl.exe spawn sites in the Codex WSL integration were missing it.
Opening a PR that:
- adds
WSL_UTF8: '1'to the two missingexecFile('wsl.exe', ...)call sites for consistency with the existing pattern - adds a regression test on each that fails without the fix and passes with it
- notes in the
orca-cliskill guide that a barecmd.exe -> wsl.execonsole outside Orca's own terminals still needschcp 65001first, since Orca doesn't own that console and can't force its codepage
PR: will link shortly.
Agent reproduction package (Windows orchestration 2026-07-16)
Host context: Windows 11 / Orca 1.4.143.0 / repo path used: docs/bug-reproductions/
Labels applied: see issue labels (has_repro or cannot_repro).
Security: Do not run user-uploaded binaries from issue attachments. Recreate fixtures from the steps/scripts below.
Issue 8475 — Chinese text garbled in Codex on Windows (WSL)
Status: needs_setup
Host: Windows 11, Orca 1.4.143
Label: none
Summary
Reporter: Chinese text from Orca CLI (e.g. orca-ide computer get-app-state) appears as mojibake under WSL on Windows (CMD.EXE-in-WSL context). Expected correct CJK; actual garbled output.
Environment gates (this host)
| Need | Present |
|---|---|
Working WSL to run orca / orca-ide inside distro |
No — hung |
Host orca computer |
Works (orca status / computer list-apps OK) |
| Console code page | 437 (OEM US) — unsafe for UTF-8 CJK |
What we verified
chcp # Active code page: 437
[Console]::OutputEncoding # ibm437
orca status --json # ok
orca computer list-apps --json # ok on host
Could not run the issue’s WSL path:
# intended, blocked by hung WSL
wsl -d Ubuntu -- bash -lc 'orca-ide computer get-app-state --app Orca --json'
Host console CP 437 is a known footgun: UTF-8 Chinese decoded as OEM/legacy produces mojibake. PowerShell browse path already pins UTF-8 for remote Windows listing (ssh-browse.ts); WSL/CLI path may still inherit legacy code pages.
Repro (another agent) when WSL healthy
- Ensure Windows UI language / a window title or accessibility tree contains Chinese, or create fixture text with CJK.
- From WSL: run
orca-ide computer get-app-state --app Orca --json(or any command that emits Chinese). - Compare host PowerShell (
chcp 65001/ UTF-8) vs WSL terminal output. - Capture raw bytes if possible (
| xxd).
Evidence
docs/bug-reproductions/issues/8475.jsondocs/bug-reproductions/evidence/8475-encoding-probe.jsondocs/bug-reproductions/evidence/8475-app-state-win.json(host capture; may not include Chinese)- WSL blocked: #8941 evidence
Why blocked
WSL command execution hung; cannot demonstrate Codex/WSL terminal mojibake end-to-end on this machine right now.
How another agent should use this
- Read this comment fully (status, expected vs actual, blockers).
- If a script is included above, copy it to a temp file and run it on a Windows 11 host with Orca installed (prefer production install under
%LOCALAPPDATA%\Programs\orca). - Capture evidence (CLI
--json, screenshots, logs) under a local folder; optionally comment results back here. - If status is
cannot_repro/ needs_setup, satisfy the listed prerequisites first, then re-attempt and flip labels: removecannot_repro, addhas_reprowhen conclusive.