Summary
Relax the java.lang.Character specification to allow code point additions for newly defined currency symbols.
Problem
Currency symbols are assigned in Currency Symbols Unicode Block (U+20A0..U+20CF), but the actual defined currency symbols in that block vary over Unicode releases. For example, the BitCoin sign (U+20BF) is only available in Unicode 10 and after. This means that it is usable only in JDK12 and after.
Solution
Relax the expected character property values for the code points in currency symbols block so that later code point additions will not affect the JavaSE conformance. For the code points currently undefined in the range of U+20A0..U+20CF, the return values from these methods may change in the future. Specifically,
Character.isDefined(char/int) returns 'true'
Character.getType(char/int) returns CURRENCY_SYMBOL
Character.getName(char/int) returns the name of the currency
Character.getDirectionality(char/int) returns the value other than DIRECTIONALITY_UNDEFINED
Character.UnicodeScript.of(char/int) returns COMMON
Specification
Add the following paragraph in java.lang.Character class description, just before the "Unicode Character Representations" section:
* <p>
* @implSpec The code points in {@link Character.UnicodeBlock#CURRENCY_SYMBOLS
* Currency Symbols} {@code UnicodeBlock} that are unassigned as of the
* <a href="#UnicodeVer">Unicode version noted above</a>,
* may be defined for currency symbols assigned by the Unicode
* Consortium from later updates. The definition of additionally assigned
* code points is implementation specific.
Modify the section that refers to the Unicode Version to an HTML anchor element, with additional explanation:
* Character information is based on <a id="UnicodeVer">the Unicode Standard,
* version 11.0.0</a> Additional currency symbols (and Japanese Era Square character) defined subsequent to that Unicode version may be present.
- csr of
-
JDK-8215303 Allowing additional currency code points from later Unicode updates
-
- Closed
-