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

QLocale on iOS gives wrong region

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P4: Low
    • 6.2.0
    • 5.15.2
    • Core: Locales (i18n)
    • None
    • iOS/tvOS/watchOS, macOS
    • qtbase/d8158c6c93fc2a83f5acacc7baaf1a840951cf1e

    Description

      Having an iPhone set to:

      Language: German
      Region: United States

      QLocale().name() gives "de_DE", QLocale().country() gives "DE"
      

      However, native objective-c code does as expected:

      NSString *countryCode = [[NSLocale currentLocale] objectForKey: NSLocaleCountryCode]
      qDebug() << "CountryCode:" << QString::fromNSString(countryCode);
      

      will print "US"

      Attachments

        Issue Links

          Activity

            People

              Eddy Edward Welbourne
              mzanetti2 Michael Zanetti
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated: