mirror of
https://github.com/TheBozos/PS2Recomp.git
synced 2026-12-01 12:54:12 -10:00
Found by TMB's release test, unzipped into "D:\tmb_rel_test\Jérôme Jeux": ps2_recomp read the TOML (its path in argv
is representable in cp1252) but not the ELF it names ("Could not load ELF file"): TOML is UTF-8 and ELFIO opens the
file with a narrow std::ifstream, which Windows reads in the ANSI code page. The tools and the runner use narrow APIs
throughout (fopen, std::ifstream on std::string, getenv, main's argv), so rather than widening each call:
- cmake/windows/utf8.manifest: activeCodePage UTF-8 (Windows 10 1903+), plus what MSYS2's default manifest says
(asInvoker, the Windows 10/11 supportedOS ids), since this RT_MANIFEST 1 takes its place.
- cmake/windows/Ps2xUtf8CodePage.cmake: ps2x_utf8_code_page(<target>), on by PS2X_WINDOWS_UTF8: MinGW gets a
resource script naming the manifest (RT_MANIFEST 1, the directory enables RC), MSVC the .manifest source.
- Applied to ps2_recomp and ps2_vu_aot (ps2xRecomp) and ps2EntryRunner (ps2xRuntime, not Android).
Checked with the build kit's GCC: a test program with the resource reports GetACP() = 65001 (1252 without).
Co-Authored-By: Claude Opus 5.5 <[email protected]>