gecko-dev/intl/locale
Makoto Kato dd679562b1 Bug 1391628 - Use fallback locale on nsICollation if locale is invalid. r=emk
Original issue is that Microsoft Dynamics CRM uses invalid lang attribute in <xsl:sort>.

<xsl:sort order="descending"
          select="@displayname[$sortColumnName='displayname'] |
                  @name[$sortColumnName='name'] |
                  exslt:node-set($FriendlyTypeNames)/types/type[@xmlName=current()/@datatype and $sortColumnName='datatype']"
          lang="$languageName"/>

Our XSLT implementation detects "$languageName" as locale name, then use it to nsICollation.

Until Gecko 54 for Windows, even if using invalid locale name for nsICollation, it uses platform locale as fallback.  But from 55, we use same implementation as macOS's to use ICU.  So this issue occurs.  ICU implementation doesn't use fallback locale if it is invalid.

We should use fallback locale if locale is invalid.  Most code for fallback locale such as FallbackEncoding uses application locale, so use it.

MozReview-Commit-ID: EKYkZG7Hnz0

--HG--
extra : rebase_source : fec89c67317d7df041f3b237122fb7e20e32fe1b
2017-08-24 23:13:42 +09:00
..
android Bug 1384835 (part 3, attempt 2) - Remove the Preferences::Get*CString() variants that return nsAdoptingCString. r=froydnj. 2017-07-31 14:28:48 +10:00
gtk Bug 1380916 - Introduce OSPreferences::GetRegionalPrefsLocales. r=jfkthame 2017-07-13 10:40:40 -07:00
mac Bug 1380916 - Introduce OSPreferences::GetRegionalPrefsLocales. r=jfkthame 2017-07-13 10:40:40 -07:00
tests Bug 1391628 - Use fallback locale on nsICollation if locale is invalid. r=emk 2017-08-24 23:13:42 +09:00
unix Bug 1356263 - Remove nsLocaleService, nsILocaleService and ns*Locale APIs. r=m_kato 2017-08-03 02:33:51 -07:00
windows Bug 1356263 - Remove nsLocaleService, nsILocaleService and ns*Locale APIs. r=m_kato 2017-08-03 02:33:51 -07:00
DateTimeFormat.cpp Bug 1379905 - Switch mozIntl, datetimebox and DateTimeFormat to use GetRegionalPrefsLocales. r=jfkthame,smaug 2017-07-14 16:47:23 -07:00
DateTimeFormat.h Bug 1313625 - Remove nsIScriptableDateFormat. r=jfkthame 2017-08-03 16:46:55 +09:00
DateTimeFormatAndroid.cpp Bug 1343766 - Add DateTimeFomat without ICU for Android. r=emk 2017-03-10 12:58:21 +09:00
encodingsgroups.properties Bug 1369025 - Remove mozilla::dom::EncodingUtils. r=hsivonen 2017-06-17 11:54:40 +09:00
langGroups.properties
language.properties
LocaleService.cpp Bug 1384835 (part 1, attempt 2) - Use nsA[C]String references instead of pointers for outparams of Get*String() pref functions. r=froydnj. 2017-07-31 10:52:51 +10:00
LocaleService.h Bug 1379420 - Introduce LocaleService::GetRegionalPrefsLocales. r=jfkthame 2017-07-08 13:54:04 -07:00
moz.build Bug 1313625 - Remove nsIScriptableDateFormat. r=jfkthame 2017-08-03 16:46:55 +09:00
mozILocaleService.idl Bug 1379420 - Introduce LocaleService::GetRegionalPrefsLocales. r=jfkthame 2017-07-08 13:54:04 -07:00
mozIOSPreferences.idl Bug 1380916 - Introduce OSPreferences::GetRegionalPrefsLocales. r=jfkthame 2017-07-13 10:40:40 -07:00
nsCollation.cpp Bug 1391628 - Use fallback locale on nsICollation if locale is invalid. r=emk 2017-08-24 23:13:42 +09:00
nsCollation.h Bug 943287 - Part 3. nsICollation fallback version for Android. r=hsivonen 2017-03-23 13:43:38 +09:00
nsCollationAndroid.cpp Bug 1376638 - Minimize uses of prmem.h. r=glandium. 2017-06-30 19:05:41 -07:00
nsCollationCID.h
nsCollationFactory.cpp Bug 943287 - Part 2. Use ICU version of nsICollation on all platform. r=hsivonen 2017-03-23 13:42:49 +09:00
nsCollationFactory.h Bug 1378712 - Remove all trailing whitespaces r=Ehsan 2017-07-06 14:00:35 +02:00
nsICollation.idl Bug 1356263 - Remove nsLocaleService, nsILocaleService and ns*Locale APIs. r=m_kato 2017-08-03 02:33:51 -07:00
nsIPlatformCharset.h Bug 1378712 - Remove all trailing whitespaces r=Ehsan 2017-07-06 14:00:35 +02:00
nsLanguageAtomService.cpp Bug 1373984 - Turn nsIDocument::mCharacterSet into mozilla::NotNull<const mozilla::Encoding*>. r=hsivonen 2017-06-18 20:37:50 +09:00
nsLanguageAtomService.h Bug 1373984 - Turn nsIDocument::mCharacterSet into mozilla::NotNull<const mozilla::Encoding*>. r=hsivonen 2017-06-18 20:37:50 +09:00
nsLocaleConstructors.h Bug 1313625 - Remove nsIScriptableDateFormat. r=jfkthame 2017-08-03 16:46:55 +09:00
nsPlatformCharset.h Bug 1351543 - Remove nsIPlatformCharset::GetDefaultCharsetForLocale. r=jfkthame 2017-03-31 10:40:19 +09:00
nsUConvPropertySearch.cpp
nsUConvPropertySearch.h
OSPreferences.cpp Bug 1380916 - Introduce OSPreferences::GetRegionalPrefsLocales. r=jfkthame 2017-07-13 10:40:40 -07:00
OSPreferences.h Bug 1380916 - Introduce OSPreferences::GetRegionalPrefsLocales. r=jfkthame 2017-07-13 10:40:40 -07:00
PluralForm.jsm
props2arrays.py