Bug Report - Non-English Characters Corruption When Editing Code in GPT Codex

Program and Version Used: Codex extension for VSCode distributed by OpenAI, version 0.5.4

Suspected Cause:
This issue appears to be caused by incompatibility with non-English characters in PowerShell 5, the default CLI for Windows.

Request:
Please allow adjustments in the settings.json file of VSCode Codex to enable support for UTF-8 encoding, or ensure compatibility by using PowerShell 7.5.

ps. However, it does perform re-encoding if requested again.

I ran into similar issue (Polish characters getting replaced with ?).

What fixed it for me was forcing UTF‑8 in the PowerShell profile + Python:

chcp 65001 > $null
$utf8NoBom = [System.Text.UTF8Encoding]::new($false)
[Console]::InputEncoding  = $utf8NoBom
[Console]::OutputEncoding = $utf8NoBom
$OutputEncoding = $utf8NoBom

$PSDefaultParameterValues[“Out-File:Encoding”] = “utf8”
$PSDefaultParameterValues[“Set-Content:Encoding”] = “utf8”
$PSDefaultParameterValues[“Add-Content:Encoding”] = “utf8”
$PSDefaultParameterValues[“Get-Content:Encoding”] = “utf8”

$env:PYTHONUTF8 = “1”
$env:PYTHONIOENCODING = “utf-8”

After restarting PowerShell, inline scripts like this polish characters test:
@’
print(“zаżółć gęślą jaźń”)
'@ | python -X utf8 -
print correctly, and files stop getting mangled.

Long‑term fix: Codex Agent should default to pwsh (PowerShell 7) or allow a shell override, or always force UTF‑8 for reads/writes.