gpt4 book ai didi

java - 什么 ISO 用于定义 Locale 中的 countryId?

转载 作者:塔克拉玛干 更新时间:2023-11-02 19:39:29 24 4
gpt4 key购买 nike

如果我阅读 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/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com