Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8215305

Allowing additional currency code points from later Unicode updates

    Details

    • Type: CSR
    • Status: Closed
    • Priority: P2
    • Resolution: Withdrawn
    • Fix Version/s: 12
    • Component/s: core-libs
    • Labels:
      None
    • Subcomponent:
    • Compatibility Risk:
      minimal
    • Compatibility Risk Description:
      Hide
      Since this is only relaxing the spec, no compatibility risk would be expected. The risk for the behavioral change in Character.isJavaIdentifierStart/Part() is also minimal for the following reasons:
      - The Currency Symbols range is very limited (U+20A0-U+20CF)
      - The change is to allow the code point, not the way around, so existing identifiers are guaranteed to work.
      - Apart from this CSR, this kind of behavior change is common when a Unicode upgrade is done.
      Show
      Since this is only relaxing the spec, no compatibility risk would be expected. The risk for the behavioral change in Character.isJavaIdentifierStart/Part() is also minimal for the following reasons: - The Currency Symbols range is very limited (U+20A0-U+20CF) - The change is to allow the code point, not the way around, so existing identifiers are guaranteed to work. - Apart from this CSR, this kind of behavior change is common when a Unicode upgrade is done.
    • Interface Kind:
      Java API
    • Scope:
      SE

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                naoto Naoto Sato
                Reporter:
                naoto Naoto Sato
                Reviewed By:
                Alan Bateman, Roger Riggs
              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: