-
Bug
-
Resolution: Duplicate
-
P3
-
None
-
1.1
-
generic
-
solaris_2.5
Locale.getISO3Language & getISO3Country do not strictly return the codes for the given Locale. Instead they return the codes for the nearest Locale for which a LocaleElements resource bundle can be found. The results tend to depend on how other java.text classes share data between parent/child ResourceBundles.
The correct behavior is this.
For Locale l = new Locale(lang, country, variant)
then
l.getISOLanguage() returns exactly lang - even if lang == ""
l.getISOCountry() returns exactly country - even if country == ""
l.getISO3Language() returns the 3 letter equivalent of lang and "" if lang == ""
l.getISO3Country() returns the 3 letter equivalent of country
and "" if country == ""
The correct behavior is this.
For Locale l = new Locale(lang, country, variant)
then
l.getISOLanguage() returns exactly lang - even if lang == ""
l.getISOCountry() returns exactly country - even if country == ""
l.getISO3Language() returns the 3 letter equivalent of lang and "" if lang == ""
l.getISO3Country() returns the 3 letter equivalent of country
and "" if country == ""
- duplicates
-
JDK-4011756 "getISO3Country" in "Locale" returns USA instead of Missing exception.
- Closed