JDK-8160199 : Language's script should be reflected in user.script on Mac OS X
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.util:i18n
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: os_x
  • Submitted: 2016-06-23
  • Updated: 2017-09-21
  • Resolved: 2017-07-03
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 Availabitlity Release.

To download the current JDK release, click here.
JDK 10 JDK 8
10 b15Fixed 8-poolResolved
Related Reports
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Description
A Locale's language may include designation of a particular script (per the  IETF BCP 47 spec) using an ISO 15924 alpha-4 script code.

A list of example languages available on Mac OS X:

az-Cyrl "Azerbaijani (Cyrillic)"
ms-Arab "Malay (Arabic)"
sr-Latn "Serbian (Latin)"
tk-Cyrl "Turkmen (Cyrillic)"
tt-Cyrl "Tatar (Cyrillic)"
tt-Latn "Tatar (Latin)"
uz-Arab "Uzbek (Arabic)"
uz-Latn "Uzbek (Latin)"
zh-Hans "Chinese (Simplified)"
zh-Hant "Chinese (Traditional)"

As of JDK-6990452, system properties are provided to reflect the script:
user.script
user.script.display
user.script.format

On Mac OS X (and perhaps elsewhere?), these properties aren't set, but they should be.

This was uncovered during work on JDK-7131356.

Comments
The gist of the issue was that the script code has not been properly treated in macOS specific code. Since it shares the same code with other Unix, the locale format should follow POSIX, such as az-Cyrl-AZ needing to be az_AZ@Cyrl. Also, this change accommodates the iOS9 language ID changes described here: https://developer.apple.com/library/content/technotes/tn2418/_index.html
2017-06-28

Proposed fix: http://cr.openjdk.java.net/~naoto/8160199/webrev.03/
2017-06-28