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

The Locale.getDisplayCountry method returns incorrect name for country Czechia

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • None
    • 8u271
    • core-libs

      The method locale.getDisplayCountry when used with Alpha-2 code "CZ" prints
      "Czech Republic". It should print "Czechia". The output is inconsistent
      with other country names.

      The ISO 3166 lists codes and names of each country.
      For example: for the country of Austria.
      https://www.iso.org/obp/ui/#iso:code:3166:AT
      This shows the Alpha-2 code, the Short name, the Short name lower case, and
      the Full Name.
      For Austria and every other country code that I have tested,
      getDisplayCountry prints the Short name lower case.
      The Short name lower case for the Czech Republic is "Czechia" which is what
      is expected.
      But, for the Alpha-2 code of "CZ" the Full name is printed instead.

      Test case: Test_locale.java
      - - -
      import java.util.Locale;

      public class Test_locale {
      public static void main(String[] args){
      Locale loc = new Locale ("", "CZ");
      System.out.println(loc.getDisplayCountry());
       }
      }
      - - -
      C:>java Test_locale
      Czech Republic
      $ java Test_locale (Linux)
      Czech Republic

            naoto Naoto Sato
            shadowbug Shadow Bug
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: