(Windows) Fixed an issue where filenames containing multi-byte Unicode characters could not be used with the %INJECT% variable

This commit is contained in:
Leon Styhre 2024-06-03 21:11:09 +02:00
parent bdebe0133c
commit 1fdcc43644

View file

@ -1605,7 +1605,11 @@ void FileData::launchGame()
<< "\""; << "\"";
std::string arguments; std::string arguments;
std::ifstream injectFileStream; std::ifstream injectFileStream;
#if defined(_WIN64)
injectFileStream.open(Utils::String::stringToWideString(injectFile));
#else
injectFileStream.open(injectFile); injectFileStream.open(injectFile);
#endif
for (std::string line; getline(injectFileStream, line);) { for (std::string line; getline(injectFileStream, line);) {
// Remove Windows carriage return characters. // Remove Windows carriage return characters.
line = Utils::String::replace(line, "\r", ""); line = Utils::String::replace(line, "\r", "");