Skip to content

VERY experimental Nintendo Switch 2 emulator

C++

[desktop] Fix path corruption for special characters on Windows (#3635)

crueter0ff84ef312d4
diff --git a/src/qt_common/util/game.cpp b/src/qt_common/util/game.cpp
index 91f43579f3..34fbd04ff9 100644
--- a/src/qt_common/util/game.cpp
+++ b/src/qt_common/util/game.cpp
@@ -99,7 +99,9 @@ try {
LOG_ERROR(Frontend, "Failed to get IPersistFile interface");
return false;
}
- hres = persist_file->Save(std::filesystem::path{shortcut_path / (name + ".lnk")}.c_str(), TRUE);
+ hres = persist_file->Save(
+ std::filesystem::path{shortcut_path / (Common::UTF8ToUTF16W(name) + L".lnk")}.c_str(),
+ TRUE);
if (FAILED(hres)) {
LOG_ERROR(Frontend, "Failed to save shortcut");
return false;