You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(nid): preserve Unicode paths on Windows - #4564
On Windows, the NID patcher loses characters outside the active ANSI code page before opening its input or export-reference library. Valid Chinese/Cyrillic paths become question marks and fail with cannot open. Use the wide Windows entry point, convert arguments to UTF-8 once, and construct native filesystem paths explicitly from UTF-8 for both patch files and export references. Other platforms retain their normal entry point.
Windows 11, MinGW-w64 GCC 15.2, CMake 4.3.1, Ninja, Release. All three new synthetic-file cases fail on main and pass with the fix: patching a Unicode directory/filename, reading a Unicode --preserve-exports reference without modifying it, and correctly naming a missing Unicode input while preserving unrelated files. The resulting symbol names are checked in the patched Mach-O fixture. No game files or PS5 hardware needed.
Full all libs build passed, including actual library patching with the new entry point.
New nid_patcher_native_paths and existing nid_patcher_macho tests passed.
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
Windows test: head 63022e23c merged onto current main0f2683cb7, together with 5 other open pull requests in one build (the merges were conflict-free); a failure would have been bisected per PR. Windows 10, MinGW GCC (WinLibs), Ninja Release, -j2: full build 0 errors; ctest for the tests this change adds or touches: nid_patcher_native_paths passed; python tools/check_conventions.py --base upstream/main passed for the combined tree. I did not run the new tests against main without the change.
Checked the merge onto current main: core/libs build and ctest 25/25 green. The wmain/-municode entry point is Windows-only, other platforms keep main, and the UTF-8 NativePath is used for every input, output and --preserve-exports open. The new test is confirmed on Windows 10/MinGW by @xXPBSXx. Merging once the full Build is green.
Checked the merge onto current main: core/libs build and ctest 25/25 green. The wmain/-municode entry point is Windows-only, other platforms keep main, and the UTF-8 NativePath is used for every input, output and --preserve-exports open. The new test is confirmed on Windows 10/MinGW by @xXPBSXx. The full Build's only failures were guest_math (linux) and guest_kqueue (windows), both aborts in tests the diff doesn't touch; re-running them. Merging once the full Build is green.
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
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.
What
On Windows, the NID patcher loses characters outside the active ANSI code page before opening its input or export-reference library. Valid Chinese/Cyrillic paths become question marks and fail with
cannot open. Use the wide Windows entry point, convert arguments to UTF-8 once, and construct native filesystem paths explicitly from UTF-8 for both patch files and export references. Other platforms retain their normal entry point.The wide-argument entry point is described in Microsoft's wmain documentation.
Tested
Windows 11, MinGW-w64 GCC 15.2, CMake 4.3.1, Ninja, Release. All three new synthetic-file cases fail on main and pass with the fix: patching a Unicode directory/filename, reading a Unicode
--preserve-exportsreference without modifying it, and correctly naming a missing Unicode input while preserving unrelated files. The resulting symbol names are checked in the patched Mach-O fixture. No game files or PS5 hardware needed.all libsbuild passed, including actual library patching with the new entry point.nid_patcher_native_pathsand existingnid_patcher_machotests passed.Checklist
main; no other open PR implements the same fix