fix(libc): open fopen and freopen paths through the wide CRT on Windows #2361
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2361"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by Aerovity on 2026-10-09T16:20:14Z.
What
Fixes #2329.
Guest paths are UTF-8, but on Windows the guest
fopenandfreopenpassed the resolved path to the narrow CRTstd::fopen/std::freopen, which read the name in the ANSI code page. Non-ASCII names were created garbled and could not be opened again.FileStream.hpp:OpenNativeFile(path, mode)opens through_wfopenwith thestd::filesystem::pathon Windows (std::fopenelsewhere).FileStream::Reopentakes astd::filesystem::pathand uses_wfreopenon Windows.FileAndHeap.cpp:fopenandfreopenpass the resolved path itself instead ofpath.string().GuestFiopen.cpp: createsセーブwithfopenandcaféwithfreopen, checks the host names withstd::filesystem, and reads both back.Note: #1549, #2033 and #2170 also change the
fopenline, as the issue says. This is a small change that can be rebased onto whichever lands first.Tested
Not tested: not built or run.
Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt: N/A.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-09T16:32:30Z.
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.
main)core/libs/prx/libc/include/FileStream.hppL3-5, L34, L69-107core/libs/prx/libc/src/FileAndHeap.cppL65-66, L79-109Imported from boykopovar/AnyPS5. Originally posted by popcoder565 on 2026-10-09T19:41:44Z.
Native Windows run, since no Windows results were posted. Setup: Windows 10 (19045), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release. Head
434e917a, merged ontomain8b393b6ein one build with 31 other PRs that had no Windows run.guest_fiopen.guest_offline_imports, broken by #2359 (reported there).No title was run.
🤖 Addressed by Claude Code
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-09T20:12:23Z.
Closing: it hasn't been built or run, and #1549, #2033 and #2170 all change this
fopenline. Reopen once it builds and the new test passes on Windows after those settle.Pull request closed