JDK-8220227 : Host Locale Provider getDisplayCountry returns error message under non-English Win10
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.util:i18n
  • Affected Version: 11,12,13
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows_10
  • CPU: x86_64
  • Submitted: 2019-03-06
  • Updated: 2019-08-29
  • Resolved: 2019-03-13
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 JDK 13
11.0.5Fixed 13 b12Fixed
Related Reports
Relates :  
Description
Under Windows 10 Japanese, Locale.getDisplayCountry() shows an error message, if Host Locale Provider is used (-Djava.locale.providers=HOST).

Test sample:
jshell -R-Djava.locale.providers=HOST
jshell> (new java.util.Locale("ar","AE")).getDisplayCountry();

Result:
"\u4e0d\u660e\u306a\u5730\u57df (AE)" (Converted by native2ascii)
This is the translated Japanese message of "Unknown Region (AE)".

Expected result:
"United Arab Emirates" 

Windows Server 2012R2 and earlier returned "United Arab Emirates" expectedly.
Windows Server 2016 has the same symptom.
English environment has no problem.

Evaluation:
The current code compares "Unknown Region (" with the result, but it could be translated.
The attached file contains the messages in all 38 Language Packs of Windows Server 2016 DVD.
I believe we can compare it with "("+RegionCode+")".
I also verified all actual strings of Country/Region in 38 languages didn't hit the condition.
Comments
Fix Request This fix is required for Non-English environments, especially East Asian countries. The patch needed to modify. RFR: https://mail.openjdk.java.net/pipermail/jdk-updates-dev/2019-August/001577.html Risk is minimum.
06-08-2019

The code in question was introduced with JDK-8039301, which needs to correctly address those cases.
07-03-2019