Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-108114

qlocale_unix.cpp mirrors {{setlocale()}}'s logic with environment variables

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Unresolved
    • P4: Low
    • None
    • 4.8.0, 6.5
    • Core: Locales (i18n)
    • None
    • Linux/Wayland, Linux/X11, Linux/Yocto, Linux/Other display system
    • 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.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            Eddy Edward Welbourne
            Eddy Edward Welbourne
            Vladimir Minenko Vladimir Minenko
            Alex Blasche Alex Blasche
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes