diff --git a/hiro/gtk/application.cpp b/hiro/gtk/application.cpp index b1bc3770b7..383b3b840a 100644 --- a/hiro/gtk/application.cpp +++ b/hiro/gtk/application.cpp @@ -145,6 +145,12 @@ auto pApplication::initialize() -> void { char** argvp = argv; gtk_init(&argc, &argvp); + + // gtk_init causes GTK to set the locale from the environment. + // Set the locale for LC_NUMERIC back to "C". It is expected to be "C" for + // the purpose of various string formatting and parsing operations. + setlocale(LC_NUMERIC, "C"); + GtkSettings* gtkSettings = gtk_settings_get_default(); //allow buttons to show icons diff --git a/hiro/qt/application.cpp b/hiro/qt/application.cpp index 3c9bd9dfbb..e7169a2325 100644 --- a/hiro/qt/application.cpp +++ b/hiro/qt/application.cpp @@ -124,6 +124,11 @@ auto pApplication::initialize() -> void { static char** argvp = argv; qtApplication = new QApplication(argc, argvp); + // Creating the QApplication causes Qt to set the locale from the environment. + // Set the locale for LC_NUMERIC back to "C". It is expected to be "C" for + // the purpose of various string formatting and parsing operations. + setlocale(LC_NUMERIC, "C"); + pKeyboard::initialize(); } diff --git a/nall/main.cpp b/nall/main.cpp index 2846312268..c11cf2ad08 100644 --- a/nall/main.cpp +++ b/nall/main.cpp @@ -19,8 +19,6 @@ auto main(int argc, char** argv) -> int { _setmode(_fileno(stderr), O_BINARY); #endif - setlocale(LC_NUMERIC, "C"); // Enforce 'standard' locale for numeric formatting - main(Arguments{argc, argv}); #if !defined(PLATFORM_WINDOWS)