Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4088754

Locale.getISO3Language & getISO3Country return incorrect results

XMLWordPrintable

      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 == ""

            rgillamsunw Richard Gillam (Inactive)
            bcbeck Brian Beck (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: