String.toLowerCase() for sigma does not use Final_Sigma condition

XMLWordPrintable

    • Type: Bug
    • Resolution: Unresolved
    • Priority: P4
    • tbd
    • Affects Version/s: 8u51, 9
    • Component/s: core-libs
    • x86_64
    • windows_7

      FULL PRODUCT VERSION :
      java version "1.8.0_51"
      Java(TM) SE Runtime Environment (build 1.8.0_51-b16)
      Java HotSpot(TM) 64-Bit Server VM (build 25.51-b03, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows [Version 6.1.7601]

      A DESCRIPTION OF THE PROBLEM :
      java.lang.ConditionalSpecialCasing uses the old (Unicode 4.0) casing condition for Greek sigma, i.e. "Final_Cased":
      ---
      Final_Cased

      Within the closest word boundaries containing C, there is a cased letter before C, and there is no cased letter after C.
      ---

      Unicode 5.0 changed this to "Final_Sigma":
      ---
      Final_Sigma

      C is preceded by a sequence consisting of a cased letter and a case-ignorable sequence, and C is not followed by a sequence consisting of a case ignorable sequence and then a cased letter.
      ---


      Specification: Unicode 5.0 (or later), 3.13 Default Case Operations

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Execute the attached test case.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      `lower` is the same string value as `expected`.
      ACTUAL -
      `lower` is not the same string value as `expected`.

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import java.util.Locale;

      public class TestFinalSigma {
          public static void main(String[] args) {
              /*
               * DerivedCoreProperties.txt
               *
               * 0041 ; Cased # Lu LATIN CAPITAL LETTER A
               * 0042 ; Cased # Lu LATIN CAPITAL LETTER B
               * 003A ; Case_Ignorable # Po COLON
               */

              /*
               * SpecialCasing.txt
               *
               * <code>; <lower>; <title>; <upper>; (<condition_list>;)? # <comment>
               * 03A3; 03C2; 03A3; 03A3; Final_Sigma; # GREEK CAPITAL LETTER SIGMA
               * 03A3; 03C3; 03A3; 03A3; # GREEK CAPITAL LETTER SIGMA
               */

              String s = "A\u03A3:B";
              String lower = s.toLowerCase(Locale.ROOT);
              String expected = "a\u03C3:b";

              System.out.println(lower);
              System.out.println(expected);
              System.out.println("Same? " + expected.equals(lower));
          }
      }
      ---------- END SOURCE ----------

            Assignee:
            Naoto Sato
            Reporter:
            Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: