According to ISO 2 character codes uk = UK . But Locale.UK.getCountry() returns GB . Did I miss something?
Locale.UK.getCountry()
According to this ,
The getCountry () method returns the two-letter abbreviation ISO 3166 for a region of a region or country.
the two-letter abbreviation ISO 3166 for the UK is really GB. uk not part of the standard, but rather a historical disaster:
uk
The use of .uk rather than .gb for a top-level domain is related to its pre-existing use in the (now obsolete) JANET name registration scheme, in which the order of address components was canceled..uk was provided in DNS to simplify translation from these addresses and with these addresses. There were plans for a possible switch to .gb to ensure proper use, but this never happened; Using .uk is now rooted and it is not possible to register a .gb domain.
Depending on your intended use, you may need to replace .gb with .uk.
uk exists for compatibility (bug in the past).
The correct gb id.
gb
The only place gb remains standard is domain names, but that is beyond the scope of this question.
To minimize potential problems, you can redirect uk to gb .