Skip to content

Fix non-ASCII game paths and ANSI code pages for shortcut launches - #694

Merged
maxjivi05 merged 5 commits into
WinNative-Emu:mainfrom
kingokksa:kingokksa
Aug 27, 2026
Merged

Fix non-ASCII game paths and ANSI code pages for shortcut launches#694
maxjivi05 merged 5 commits into
WinNative-Emu:mainfrom
kingokksa:kingokksa

Conversation

@kingokksa

Copy link
Copy Markdown
Contributor

Shortcuts with non-ASCII (e.g. Chinese/Japanese) game paths failed while launching the same exe from inside the container worked, and legacy ANSI games showed '?' for all non-western text. Three app-side fixes, no layer or symlink changes:

Pin LC_ALL to glibc's built-in C.UTF-8 and pass the user's locale via LANG: the imagefs has no locale data, so a real locale made setlocale() fall back to the ASCII-only "C" and corrupted every non-ASCII argument.
Deploy a UTF-8 activeCodePage SxS manifest next to winhandler.exe (and the other ANSI launchers): their ShellExecuteA-based launch mangled non-ASCII paths through code page 1252, turning them into '?'.
Deploy a locale activeCodePage manifest next to the game exe when the shortcut/container LC_ALL is set: Wine 10 accepts a locale name there (ja-JP -> cp932), which is the Wine equivalent of Locale Emulator for legacy Shift-JIS games. Unicode games are unaffected.

kingokksaand others added 5 commits August 21, 2026 13:26
Shortcuts with non-ASCII (e.g. Japanese/Chinese) game paths failed while
launching the same exe from inside the container worked, and legacy ANSI
games showed '?' for all non-western text. Three app-side fixes, no layer
or symlink changes:
- Pin LC_ALL to glibc's built-in C.UTF-8 and pass the user's locale via
LANG: the imagefs has no locale data, so a real locale made setlocale()
fall back to the ASCII-only "C" and corrupted every non-ASCII argument.
- Deploy a UTF-8 activeCodePage SxS manifest next to winhandler.exe (and
the other ANSI launchers): their ShellExecuteA-based launch mangled
non-ASCII paths through code page 1252, turning them into '?'.
- Deploy a locale activeCodePage manifest next to the game exe when the
shortcut/container LC_ALL is set: Wine 10 accepts a locale name there
(ja-JP -> cp932), which is the Wine equivalent of Locale Emulator for
legacy Shift-JIS games. Unicode games are unaffected.
Condense the multi-paragraph blocks added with the activeCodePage manifests down to
the one-to-three line style used elsewhere in these files, fold the duplicated manifest
XML into a single codePageManifest(identity, codePage) builder, and replace the
hardcoded "WinNative.Utf8CodePage" literal with a UTF8_MANIFEST_MARKER constant.
Generated manifest bytes are unchanged, so manifests already deployed on device still
compare equal and are not rewritten.
The embedded-manifest check only reached logcat, so a user setting LC_ALL to
fix a legacy Shift-JIS/GBK game saw unchanged mojibake with no explanation.
Parse the RT_MANIFEST blob exeResourceData() already reads instead of only
null-checking it, so the two cases are distinguishable: an exe that declares
its own activeCodePage, and one that embeds a manifest without one. Report
both, plus the pre-existing game-ships-its-own-manifest bail-out, as a toast
raised once the game window is up.
@maxjivi05
maxjivi05 merged commit 356a842 into WinNative-Emu:mainAug 27, 2026
4 checks passed
kingokksa added a commit to kingokksa/WinNative that referenced this pull request Aug 27, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@kingokksa@maxjivi05