如果我阅读 Locale 的 Javadocs,我会看到英国存在一个常量 UK(我认为 :P)
但是如果我阅读类文档,它会说:
The country argument is a valid ISO Country Code. These codes are the upper-case, two-letter codes as defined by ISO-3166. You can find a full list of these codes at a number of sites, such as: http://www.iso.ch/iso/en/prods-services/iso3166ma/02iso-3166-code-lists/list-en1.html
但是,在 ISO 3166 中,两个字母代码为 United Kingdom is GB
那么,为什么英国 Locale 的 countryId 是 UK? Locale对象的countryId用什么iso?
最佳答案
确实是 ISO 3166。常量 java.util.Locale.UK
的值为 "en_GB"
。因此,尽管它被称为英国,但它具有正确的值(value)。
关于java - 什么 ISO 用于定义 Locale 中的 countryId?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4417182/