-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
6.3, 6.11
-
None
QString::localeAwareCompare() delegates (via a helper)
- for ICU: via QCollator::defaultCompare() to a default-constructed QCollator, based on a default-constructed QLocale's collation()
- everwhere else: to system APIs which presumably use the system locale.
When QLocale::setDefault() has changed the default to something other than the system locale, this will produce inconsistent results. It would be fairly easy to change the QCollator::defaultCompare() side to use the system locale, but it seems logically more correct to have all sides use the default locale, when it isn't the system. This better answer may, however, be hard to implement in practice, as some platforms are using the POSIX backend for QCollator, which can only support the system and C locales.
We may therefore have to either change ICU's branch to also use the system locale (consistent, but not ideal) or live with the present inconsistency. In any case, we need to document whichever reality we decide to live with: QString::localeAwareCompare() currently says nothing about which locale it's aware of.