From 43dbb0c089cf96299dea076982cbdd9c464dd249 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 7 Jun 2025 21:13:21 -0400 Subject: [PATCH] add special case for setting locale on macOS based on suggestion from OVITO developers --- tools/lammps-gui/main.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/lammps-gui/main.cpp b/tools/lammps-gui/main.cpp index 5f2599c3df..1cd5d41532 100644 --- a/tools/lammps-gui/main.cpp +++ b/tools/lammps-gui/main.cpp @@ -36,8 +36,13 @@ int main(int argc, char *argv[]) qRegisterMetaTypeStreamOperators>("QList"); #endif +#ifndef Q_OS_MACOS // enforce using the plain ASCII C locale with UTF-8 encoding within the GUI. qputenv("LC_ALL", "C.UTF-8"); +#else + // macOS does not support "C" locale with UTF-8 encoding, but Qt requires UTF-8 + qputenv("LC_ALL", "en_US.UTF-8"); +#endif QApplication app(argc, argv); QCoreApplication::setOrganizationName("The LAMMPS Developers");