What ISO is used to determine the countryId in the locale?

If I read the Javadocs for Locale, I see that there is a permanent UK for the United Kingdom (I think: P)

But if I read the class documentation, it says:

The country argument is the current ISO Country Code standard. These codes are uppercase, two-letter codes as defined by ISO-3166. You can find a complete list of these codes on the site number, such as: http://www.iso.ch/iso/en/prods-services/iso3166ma/02iso-3166-code-lists/list-en1.html

But in ISO 3166, two code characters for the United Kingdom are GB

So why is countryId for Locale in UK - UK? What iso is used for countryId Locale object?

+3
source share
2 answers

This is really ISO 3166. Constant java.util.Locale.UKmatters "en_GB". Therefore, despite the fact that it is called the United Kingdom, it has the correct meaning.

+1
source

java.util.Locale.UK , . ISO, Locale , , "GB" , ISO 3166. , ISO "UK" (. Wikipedia ). locale "UK", "GB" , , , , , "", "GB" , , , ISO.

+1

Source: https://habr.com/ru/post/1779747/


All Articles