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: Closed
  • Resolution: Fixed
  • OS: os_x
  • Submitted: 2016-06-23
  • Updated: 2017-12-14
  • 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 Availability Release.

To download the current JDK release, click here.
JDK 10 JDK 8
10 b15Fixed 8-poolUnresolved
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
28-06-2017

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