JDK-8198228 : Spec clarification: j.u.Locale.getDisplayName()
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.util:i18n
  • Affected Version: 10
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2018-02-15
  • Updated: 2018-02-23
  • Resolved: 2018-02-16
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 11
11 b02Fixed
Related Reports
CSR :  
Relates :  
Description
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.

Comments
Should be clarified in the method description.
15-02-2018