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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Fixed
    • Affects Version/s: 5.15, 6.1, 6.2
    • Fix Version/s: None
    • Component/s: Core: Locales (i18n)
    • Labels:
      None
    • Platform/s:
      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

            Assignee:
            Eddy Edward Welbourne
            Reporter:
            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