Main: force UTF-8 locale.

This commit is contained in:
Guillaume Jacquemin 2022-11-21 09:50:43 +01:00
parent a33cbdfad6
commit 714d8cc6bb

View file

@ -25,6 +25,13 @@
#include "SaveTool/SaveTool.h" #include "SaveTool/SaveTool.h"
int main(int argc, char** argv) { int main(int argc, char** argv) {
auto str = std::setlocale(LC_ALL, ".utf-8");
if(str && !Containers::StringView{str}.hasSuffix(".utf8")) {
SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Error",
"Your system doesn't support UTF-8.", nullptr);
return EXIT_FAILURE;
}
#ifndef SAVETOOL_DEBUG_BUILD #ifndef SAVETOOL_DEBUG_BUILD
std::ofstream output{"SaveToolLog.txt", std::ios::trunc|std::ios::out}; std::ofstream output{"SaveToolLog.txt", std::ios::trunc|std::ios::out};