Details
-
Suggestion
-
Resolution: Unresolved
-
P4: Low
-
None
-
4.8.0, 6.5
-
None
-
-
5
Description
The set-up of the system locale on (non-Apple) Unix consults assorted environment variables to determine how we should do localization. The way it does this exactly matches what setlocale(category, "") does in any case; and QCoreApplication::initLocale() does call setlocale(LC_ALL, ""), so we should be able to just use setlocale(category, nullptr) instead of consulting the environment directly. This would have the benefit of respecting any changes the program may have made since instantiating Q*Application, e.g. in response to command-line options it supports, by which the user has requested a change of environment compared to the one their system is configured to use.
However, this is only an option if QLocale is specified to not be usable before Q*Application is instantiated. That should be checked first.