Uh oh!
There was an error while loading. Please reload this page.
Fix non-ASCII game paths and ANSI code pages for shortcut launches - #694
Merged
Conversation
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.
Uh oh!
There was an error while loading. Please reload this page.
kingokksa added a commit
to kingokksa/WinNative
that referenced
this pull request
Aug 27, 2026
… into consolidated branch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.