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

String.toLowerCase do not work for some concatenated strings

XMLWordPrintable

    • 9
    • b25
    • generic
    • generic
    • Verified


        This bug is reported by Robert Muir (rcmuir@gmail.com) from Apache Lucene project.


        On 05/ 6/14 12:17 AM, Robert Muir wrote:
        > It seems there is a bug in String.toLowerCase.
        > This character is old since unicode 3.1 and does not have any
        > context-sensitive casing behavior.
        >
        > public void testThis() throws Exception {
        > String text = "\ud801\udc1c"; // U+1041C DESERET
        > CAPITAL LETTER THEE
        > String expectedLower = "\ud801\udc44" ; // U+10444 DESERET
        > SMALL LETTER THEE
        >
        > // lowercase works correct in isolation
        > assertEquals(expectedLower, text.toLowerCase(Locale.ROOT));
        >
        > // add "A" in front, it breaks
        > String text2 = "A" + text;
        > String expected2 = "a" + expectedLower;
        > assertEquals(expected2, text2.toLowerCase(Locale.ROOT));
        > }



        Given the
                      String text = "\ud801\udc1c"; // U+1041C
                      String text2 = "A" + text;
                      System.out.println(text2.toLowerCase(Locale.ROOT));


        The output with jdk 8 and 8u20 ea b12 is : aU+10444 as expected. - (Pass).
        The output with jdk 9 ea b11 is: aU+1041C. - (Fail)
         




              sherman Xueming Shen
              bvaidya Balchandra Vaidya
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: