JDK-8245072 : ISO 3166 country names are not up to date
  • Type: Bug
  • Component: globalization
  • Sub-Component: locale-data
  • Affected Version: 14,15
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2020-05-13
  • Updated: 2023-07-25
  • Resolved: 2023-07-25
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
tbdFixed
Description
A DESCRIPTION OF THE PROBLEM :
The country names in LocaleNames.properties should reflect the ISO 3166 standard. There are some discrepancies.

The Javadoc for Locale.getDisplayCountry states "Returns a name for the locale's country that is appropriate for display to the user." This can explain some of the differences, for example, "United Kingdom" vs. "United Kingdom of Great Britain and Northern Ireland".

That said, there are some country names that are clearly wrong:
CV should be "Cabo Verde" (http://news.nationalgeographic.com/news/2013/12/131212-maps-cabo-verde-cartography-science-cape-verde-africa)
CZ should be "Czechia" (https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes#cite_note-18)
MK should be "North Macedonia" (https://news.un.org/en/tags/prespa-agreement)
RE should be "Réunion" (not "Reunion")
SZ should be "Eswatini" (https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes#cite_note-19)

Some more could be argued as well, particularly in respect of consistency:
For example, why is the country name for BN "Brunei" and not "Brunei Darussalam" while for CD "The Democratic Republic Of Congo" is used instead of the short form "Congo"?

VA uses "Vatican" while the official name is "Holy See"
VN should probably be "Viet Nam" instead of Vietnam

Lastly, there are still countries in the list which have been removed ("transitionally reserved") from the ISO standard:
AN Netherlands Antilles
CS Serbia and Montenegro

We could make a case for keeping them but then the question becomes why other codes with the same status should not be included as well.
https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Transitional_reservations

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
The names are defined here: http://hg.openjdk.java.net/jdk/jdk14/file/57148c79bd75/src/java.base/share/classes/sun/util/resources/LocaleNames.properties#l868

It can be printed running:

for (String country : Locale.getISOCountries())
{
    System.out.println(country + ": " + new Locale("", country).getDisplayCountry(Locale.getDefault()));
}


FREQUENCY : always



Comments
This was fixed in JDK-8255086
25-07-2023

First of all, the default locale data are derived from Unicode Consortium's CLDR project, where most of the names the submitter claimed are correct names (except "CV" https://unicode-org.github.io/cldr-staging/charts/37/by_type/locale_display_names.territories__africa_.html#4fa79d3fd37061d5 using "Cape Verde" as English name). So that is working as expected. The legacy locale data represented by COMPAT is using the source LocaleNames.properties which needs to be updated. Transferring to G11n team for this work. As to the obsolete country codes, we keep them for compatibility. There are missing ones as the submitter pointed out, but those did not exist at the time of collecting the locale data, or simply missing the localized names. Yes, it is inconsistent, but I see little benefit to fix it.
15-05-2020