Description:
When using Codex Agent on Windows (VS Code / Cursor / Windsurf), files containing Cyrillic comments are displayed incorrectly (garbled characters). The agent appears to invoke powershell.exe by default, which uses ANSI instead of UTF-8.
Expected behavior:
-
Files with UTF-8 encoding (with or without BOM) should display correctly.
-
Ideally, the agent should:
-
Use PowerShell 7 (
pwsh) by default (UTF-8 is the default there), or -
Explicitly pass
-Encoding UTF8when reading/writing files, or -
Provide a setting to override the shell used for Agent actions.
-
Steps to reproduce:
-
Open a UTF-8 encoded JavaScript/TypeScript file with Cyrillic comments in VS Code on Windows.
-
Run Codex Agent and ask it to show the first 10 lines.
-
Cyrillic characters are replaced with question marks / invalid symbols.
Notes:
-
This does not happen in the built-in chat (Cursor/Windsurf) because text is read directly from the editor buffer.
-
Only the Agent (when reading/writing via PowerShell) shows corrupted characters.
-
Using Node.js or
pwshwith-Encoding UTF8works correctly.
Environment:
-
Windows 11 (latest build, exact version unknown but fully up to date)
-
VS Code 1.103.2
-
Codex extension 0.4.0
-
Node.js 22.17
-
PowerShell 7.5.2 installed, but Agent still defaults to legacy Windows PowerShell 5.1
-
Hardware: standard desktop PC
