-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support Unicode file paths for non-VC++ #250
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the contribution, using std::filesystem
is on the to-do list. This is fine but please drop the preprocessor block, VC++ supports it too.
Both files are missing |
Interesting, I'll troubleshoot these builds more. |
Why is bumping to Catalina required for |
The Mac build gave this error after removing the
I tried bumping the version up to verify that the build passed, though I agree this is not an ideal solution. It may be something about the older macOS versions not defaulting to C++17, which I'll look into. |
I suppose this is using xcode, it would make sense then. |
The CI build actually failed for Mac too before bumping the OS version (https://github.com/vgmtrans/vgmtrans/pull/250/checks?check_run_id=3634755614). From the logs, it seems to be pulling the Xcode version of
Perhaps it's possible to link in a more up-to-date version of |
I see, what a mess. It's probably easier to set up ghc::filesystem (with the preprocessor machinery to detect if the platform needs it) and call it a day |
This is not how we handle external dependencies. Besides Qt, which is prebuilt (and optional, being Windows-only and intended to save the hassle of installing the whole framework), we use subtrees (this is preferable especially because ghc::filesystem is header only). We then wrap it in a CMakeLists for the CMake build system and a .vcprojx for WTL. If you don't know how to write a .vcprojx you can copy zlib's, which is pretty simple and was hand-written. It will need to be added to WTL using project references |
Okay, I'll remove the submodule and copy the library instead. |
41e1757
to
a180801
Compare
0cff909
to
d284b1a
Compare
Okay, managed to get a setup working. |
Thanks, I suppose this is fine. If it ends up being slower than the stdlib's implementation we can switch to including the header with the dynamic selection. |
Support Unicode file paths for non-VC++
Description
Use
filesystem::path
instead of C-strings when opening/saving files.Motivation and Context
On non-Visual-C++ builds (e.g., macOS builds), the fallback code for opening files in
RawFile
doesn't handle non-ASCII characters properly, and fails to open files named with these characters. Seen with the "é" character when attempting to import a Pokémon ROM.How Has This Been Tested?
Tested by importing a Pokémon Pearl ROM with the "é" character in the file name. Music files load correctly from the ROM with this change.
Tested on macOS 11.5.2 with Apple Clang++ ARM64 compiler (version 12.0.5, clang-1205.0.22.11).
Screenshots (if appropriate):
N/A
Types of changes
Checklist: