Preserve Unicode paths in the Windows diagnostic probe #18

Manually merged
github merged 1 commit from gh-pr/18/head into gh-pr/18/base 2026-11-26 20:44:28 +00:00
Owner

@⁠RavenCurseBurg on GitHub · 2026-11-25 08:23 UTC · original
RavenCurseBurg:fix/probe-unicode → main · +168 −26 · 7 files · 1 commits · merged 2026-11-25 12:51 UTC

Fixes #17.

On Windows, gtavi_probe --to-posix could print a different directory name and still exit successfully. On code page 936, even the representable character 乗 caused the reverse translation to reject a valid POSIX path.

The Windows entry point now reads wide arguments and passes UTF-8 to the existing path translator. Translations and errors go to the native console through WriteConsoleW, or to a redirected stream as UTF-8. The probe leaves the console code page alone. A new CTest exercises both translation directions, a Unicode mount override and a usage error. All inputs are synthetic path strings.

Verification

  • Windows 11 x64, MinGW-w64 GCC 15.2, ANSI code page 936. With CMake 3.21.0 (the project minimum), the new CTest fails on main and all three CTests pass on this branch. In private console buffers using output code pages 936 and 65001, read-back confirmed the character on both stdout and stderr and the original code page after each invocation.
  • Fourteen existing ASCII invocations matched main's exit codes, stdout and timestamp-normalized stderr. On macOS 15.7.9 x86-64, the historical pre-#8 executable reproduced the incorrect exit code. This PR passed all three CTests and kept the documented fallback behavior for host facts and translations. Darwin tooling run
  • All three CTests passed on hosted Windows MSVC, Linux GCC and Linux Clang. The local Python suites passed all 41 tooling tests and 10 app0 fixture tests. All six fork CI jobs passed

Agent environment: Codex + GPT-6.2 Astra (xhigh).

**@⁠RavenCurseBurg** on GitHub · 2026-11-25 08:23 UTC · [original](https://github.com/JamesCicada/GTAVI-Recomp/pull/18) `RavenCurseBurg:fix/probe-unicode` → `main` · +168 −26 · 7 files · 1 commits · merged 2026-11-25 12:51 UTC Fixes #17. On Windows, `gtavi_probe --to-posix` could print a different directory name and still exit successfully. On code page 936, even the representable character `乗` caused the reverse translation to reject a valid POSIX path. The Windows entry point now reads wide arguments and passes UTF-8 to the existing path translator. Translations and errors go to the native console through `WriteConsoleW`, or to a redirected stream as UTF-8. The probe leaves the console code page alone. A new CTest exercises both translation directions, a Unicode mount override and a usage error. All inputs are synthetic path strings. ### Verification - Windows 11 x64, MinGW-w64 GCC 15.2, ANSI code page 936. With CMake 3.21.0 (the project minimum), the new CTest fails on main and all three CTests pass on this branch. In private console buffers using output code pages 936 and 65001, read-back confirmed the character on both stdout and stderr and the original code page after each invocation. - Fourteen existing ASCII invocations matched main's exit codes, stdout and timestamp-normalized stderr. On macOS 15.7.9 x86-64, the historical pre-#8 executable reproduced the incorrect exit code. This PR passed all three CTests and kept the documented fallback behavior for host facts and translations. [Darwin tooling run](https://github.com/RavenCurseBurg/GTAVI-Recomp/actions/runs/45579010669/job/139084018664) - All three CTests passed on hosted [Windows MSVC](https://github.com/RavenCurseBurg/GTAVI-Recomp/actions/runs/45575558372/job/139072511631), [Linux GCC](https://github.com/RavenCurseBurg/GTAVI-Recomp/actions/runs/45575558372/job/139072511098) and [Linux Clang](https://github.com/RavenCurseBurg/GTAVI-Recomp/actions/runs/45575558372/job/139072511560). The local Python suites passed all 41 tooling tests and 10 app0 fixture tests. [All six fork CI jobs passed](https://github.com/RavenCurseBurg/GTAVI-Recomp/actions/runs/45575558372) Agent environment: Codex + GPT-6.2 Astra (xhigh).
Read the original wide arguments, translate them as UTF-8, and write Unicode paths to the native console or redirected streams. Cover both translation directions, a custom mount and usage diagnostics with synthetic names.

Agent environment: Codex + GPT-6.2 Astra (xhigh)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 20:44:26 +00:00
github manually merged commit 6c177f51b8 into gh-pr/18/base 2026-11-26 20:44:28 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.