Set C++ global locale as well as C one, so wide to narrow works

This commit is contained in:
Bill Somerville 2021-01-27 23:24:07 +00:00
parent 3629a4e071
commit 70802f4574
No known key found for this signature in database
GPG Key ID: D864B06D1E81618F
1 changed files with 8 additions and 5 deletions

View File

@ -5,7 +5,7 @@
#include <iterator> #include <iterator>
#include <algorithm> #include <algorithm>
#include <ios> #include <ios>
#include <locale.h> #include <locale>
#include <fftw3.h> #include <fftw3.h>
#include <QSharedMemory> #include <QSharedMemory>
@ -129,10 +129,13 @@ int main(int argc, char *argv[])
// LOG_INFO ("--------------------------- Resources ----------------------------"); // LOG_INFO ("--------------------------- Resources ----------------------------");
QLocale locale; // get the current system locale QLocale locale; // get the current system locale
setlocale (LC_NUMERIC, "C"); // ensure number forms are in
// consistent format, do this after // Set C/C++ locale used for logging etc.
// instantiating QApplication so #if defined (Q_OS_WIN)
// that GUI has correct l18n std::locale::global (std::locale ("C"));
#else
std::locale::global (std::locale ("en_US.UTF-8"));
#endif
// Override programs executable basename as application name. // Override programs executable basename as application name.
a.setApplicationName ("WSJT-X"); a.setApplicationName ("WSJT-X");