Uploaded image for project: 'Harmony'
  1. Harmony
  2. HARMONY-6650

Character.getType(int) inconsistent with Character.getType(char): uses different version of unicode

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Classlib
    • Labels:
      None

      Description

      While looking at Character, i noticed the code looked very different for 'int' than 'char' here.
      in particular the int method defers to ICU, but the char method binsearches its own table.
      and the comment for that table is:

      // Unicode 3.0.1 (same as Unicode 3.0.0)
      private static final char[] typeValues ....

      But Unicode 3 is the wrong version for java5/6

      So, i tried a character whose type changed from 3.0 to 4.0, just to see.
      For example, compare these two results:

      Character.getType('\u17B5') = 8 (combining mark)
      Character.getType((int) '\u17B5') = 16 (format)

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              rcmuir Robert Muir
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated: