Locale.UK 和国家/地区代码
根据 ISO 2 字符代码 uk = 英国。但 Locale.UK.getCountry()
返回 GB。我错过了什么吗?
According to the ISO 2 character codes uk = United Kingdom. But Locale.UK.getCountry()
is returning GB. Am I missing something?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
根据 此,
英国的 ISO 3166 两个字母缩写确实是 GB。
uk
不是标准的一部分,而更多的是历史偶然:根据您的目标用途,您可能需要将 .gb 替换为 .uk。
According to this,
The ISO 3166 two-letter abbreviation for the UK is indeed GB.
uk
is not part of the standard, but more of a historical accident:Depending on your target use, you may need to replace .gb with .uk.
uk
的存在是出于兼容性原因(过去的一个错误)。正确的 ID 是
gb
。gb
保持标准的唯一地方是域名,但这超出了本问题的范围。为了最大限度地减少潜在问题,您可以将
uk
重新映射到gb
。uk
is there for compatibility reasons (a mistake in the past).The correct id is
gb
.The only place where
gb
remains standard is the domain names, but this is outside the scope of this question.To minimize potential issues you could remap
uk
togb
.