From 265698d6bfe5a2e868b3ee4196f4467e74d52f3e Mon Sep 17 00:00:00 2001 From: offtkp Date: Wed, 25 Sep 2024 18:49:20 +0300 Subject: [PATCH] I hate Windows even more today --- src/common/config.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/common/config.cpp b/src/common/config.cpp index d3464ccb7..bfa7d6391 100644 --- a/src/common/config.cpp +++ b/src/common/config.cpp @@ -450,7 +450,18 @@ void save(const std::filesystem::path& path) { fmt::print("Filesystem error: {}\n", error.message()); } - fmt::print("Saving new configuration file {}\n", fmt::UTF(path.u8string())); + try { +#ifdef _WIN32 + fmt::print(L"Saving new configuration file {}\n", path.wstring()); +#else + fmt::print("Saving new configuration file {}\n", fmt::UTF(path.u8string())); +#endif + } catch (...) { + // Path to string conversion particularily on Windows is quite the mess. Just to make + // sure the emulator doesn't somehow crash due to a bad string conversion + // we catch the exception and print a generic message. + fmt::print("Saving new configuration file\n"); + } } data["General"]["isPS4Pro"] = isNeo;