-
Suggestion
-
Resolution: Unresolved
-
P4: Low
-
None
-
4.8.0, 6.5
-
None
-
-
5
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.
We also have (or have had) code in our configuration of X/xcb and related things that mirrors the same environment checks, so requires similar attention. A full trawl through our code-base for further echoes of the same is probably needed.
- relates to
-
QTBUG-138582 QSystemLocaleData/Unix relocks environmentMutex many times for one update
-
- Open
-