diff --git a/src/common/config.cpp b/src/common/config.cpp index 4b264b140..d3464ccb7 100644 --- a/src/common/config.cpp +++ b/src/common/config.cpp @@ -6,6 +6,7 @@ #include #include // for wstring support #include +#include "common/logging/formatter.h" #include "config.h" namespace Config { @@ -449,15 +450,7 @@ void save(const std::filesystem::path& path) { fmt::print("Filesystem error: {}\n", error.message()); } - try { - // Printing wstring (which a path is natively on Windows) to console is generally shaky. - // There's an open issue on fmtlib (#3491) where doing so can cause a crash, and it has - // happened to us too. We're going to assume the path can be converted to a string and - // printed safely, not printing the path if it can't. - fmt::print("Saving new configuration file {}\n", path.string()); - } catch (...) { - fmt::print("Saving new configuration file\n"); - } + fmt::print("Saving new configuration file {}\n", fmt::UTF(path.u8string())); } data["General"]["isPS4Pro"] = isNeo; diff --git a/src/qt_gui/main.cpp b/src/qt_gui/main.cpp index 50de68509..8c565a19b 100644 --- a/src/qt_gui/main.cpp +++ b/src/qt_gui/main.cpp @@ -8,10 +8,18 @@ #include "game_install_dialog.h" #include "main_window.h" +#ifdef _WIN32 +#include +#endif + // Custom message handler to ignore Qt logs void customMessageHandler(QtMsgType, const QMessageLogContext&, const QString&) {} int main(int argc, char* argv[]) { +#ifdef _WIN32 + SetConsoleOutputCP(CP_UTF8); +#endif + QApplication a(argc, argv); // Load configurations and initialize Qt application