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

Linux setlocale() can report C when ICU is using en as locale

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2: Important
    • None
    • 6.1, 5.15, 6.2
    • Core: Locales (i18n)
    • None
    • Linux/X11

    Description

      Setting LC_COLLATE=en.UTF-8 LANG=en.UTF-8 LC_ALL=en.UTF-8 LANGUAGE=en in my environment and running tst_QString::localeAwareCompare() reveals that setlocale(LC_COLLATE, nullptr) and setlocale(LC_ALL, nullptr) both return "C"; but ICU is (correctly) using the collation of English. In contrast, when I s/en/C/ in all those environment variables, ICU (again correctly) uses the C locale.
      This makes it tricky for the relevant test to determine whether it's really using the C locale, since the backend it's delegating to is ICU.

      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
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes