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

String.toLowerCase/toUpperCase incorrect for supplementary characters

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 5.0M15
    • Fix Version/s: 5.0M15
    • Component/s: Classlib
    • Labels:
      None

      Description

      Simple testcase:

          assertEquals("\uD801\uDC44", "\uD801\uDC1C".toLowerCase());
      

      Looking at modules/luni/src/main/java/java/lang/String.java, the problem is these methods iterate code units (char) not codepoints (int),
      and use Character.toLowerCase(char) and Character.toUpperCase(char), instead of Character.toLowerCase(int), and Character.toUpperCase(int)

        Attachments

        1. harmony6649.patch
          11 kB
          Tim Ellison
        2. HARMONY-6649_tests.patch
          1 kB
          Robert Muir
        3. HARMONY-6649_filepermission.patch
          0.9 kB
          Robert Muir

          Activity

            People

            • Assignee:
              tellison Tim Ellison
              Reporter:
              rcmuir Robert Muir

              Dates

              • Created:
                Updated:
                Resolved:

                Issue deployment