From abc14c00a0202dd6142a37a10e37c809fa47579e Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 5 Mar 2025 17:40:36 -0500 Subject: [PATCH] use different method to enforce the C locale in LAMMPS GUI --- tools/lammps-gui/main.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/lammps-gui/main.cpp b/tools/lammps-gui/main.cpp index 53bdaca8fd..5f2599c3df 100644 --- a/tools/lammps-gui/main.cpp +++ b/tools/lammps-gui/main.cpp @@ -20,6 +20,7 @@ #include #include #include +#include #include #include @@ -35,9 +36,10 @@ int main(int argc, char *argv[]) qRegisterMetaTypeStreamOperators>("QList"); #endif + // enforce using the plain ASCII C locale with UTF-8 encoding within the GUI. + qputenv("LC_ALL", "C.UTF-8"); + QApplication app(argc, argv); - // enforce using the plain ASCII C locale within the GUI. - QLocale::setDefault(QLocale::c()); QCoreApplication::setOrganizationName("The LAMMPS Developers"); QCoreApplication::setOrganizationDomain("lammps.org"); QCoreApplication::setApplicationName("LAMMPS-GUI - QT" stringify(QT_VERSION_MAJOR));