mirror of
https://github.com/boykopovar/AnyPS5.git
synced 2026-10-22 08:33:12 -05:00
The MinGW CRT delivers argv to main as ANSI code page bytes, and every narrow string became a filesystem path through the same code page, so a game in a directory with characters outside the code page failed to open (#2692). Read the command line as Unicode (wmain via -municode), keep paths as UTF-8 strings, convert at the filesystem boundaries through Io::NativePath and Io::Utf8Path, and run the --autorun output through CreateProcessW.
(cherry picked from commit 30a5181f8a)
15 lines
237 B
C++
15 lines
237 B
C++
#ifndef IO_NATIVEPATH_HPP
|
|
#define IO_NATIVEPATH_HPP
|
|
|
|
#include <filesystem>
|
|
#include <string>
|
|
|
|
namespace Io {
|
|
|
|
std::filesystem::path NativePath(const std::string& path);
|
|
std::string Utf8Path(const std::filesystem::path& path);
|
|
|
|
}
|
|
|
|
#endif
|