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

QLocale on iOS gives wrong region

XMLWordPrintable

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

      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"

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

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

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes