-
Bug
-
Resolution: Fixed
-
P3
-
10
-
b02
Starting VM with "-Duser.country=CN -Duser.language=zh” as default locale.
According to the Locale.getDisplayName() spec the values in parentheses should be comma separated:
http://download.java.net/java/jdk10/docs/api/java/util/Locale.html#getDisplayName()
However for the following example
Locale locale = new Locale("lll", "CCC", "VVV");
System.out.println("Locale.getDefault() = " + Locale.getDefault());
System.out.println("locale.getDisplayName() = " + locale.getDisplayName());
I get
Locale.getDefault() = zh_CN
locale.getDisplayName() = lll (CCC、VVV)
and (with default locale)
Locale.getDefault() = en_GB
locale.getDisplayName() = lll (CCC, VVV)
(see the difference in the used separator - it's comma v.s. '、')
Specification needs to be corrected.
According to the Locale.getDisplayName() spec the values in parentheses should be comma separated:
http://download.java.net/java/jdk10/docs/api/java/util/Locale.html#getDisplayName()
However for the following example
Locale locale = new Locale("lll", "CCC", "VVV");
System.out.println("Locale.getDefault() = " + Locale.getDefault());
System.out.println("locale.getDisplayName() = " + locale.getDisplayName());
I get
Locale.getDefault() = zh_CN
locale.getDisplayName() = lll (CCC、VVV)
and (with default locale)
Locale.getDefault() = en_GB
locale.getDisplayName() = lll (CCC, VVV)
(see the difference in the used separator - it's comma v.s. '、')
Specification needs to be corrected.
- csr for
-
JDK-8198236 Spec clarification: j.u.Locale.getDisplayName()
- Closed
- relates to
-
JDK-8176841 Additional Unicode Language-Tag Extensions
- Resolved