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

JCK: String.toUpperCase() returns wrong values for 1:M case mapping

    Details

    • Subcomponent:
    • CPU:
      generic
    • OS:
      generic

      Description



      Name: skR10005 Date: 02/15/2001



      1. jdk1.4.0beta-b51 API method java.lang.String.toUpperCase()
      returns wrong values for 27 chars. Returned values do not correspond
      to Unicode 3.0 definition.

      2. jdk1.4.0beta-b51 API method java.lang.String.toLowerCase()
      returns wrong values for 1 char (\u03A3). Returned value does not correspond
      to Unicode 3.0 definition.

      Due to this, new JCK Merlin tests
      api/java_lang/String/multimapping.html#CaseMapping[String2301]
      api/java_lang/String/multimapping.html#CaseMapping[String2303]
      api/java_lang/String/multimapping.html#CaseMapping[String2304]
      fail.

      Sample code and execution log are below -
      ======================= test.java ================================
      public class test {
          public static void main(String[] argv) {
              boolean failed = false;
              String[] chars = {"\u00DF","\uFB00","\uFB01","\uFB02","\uFB03",
                          "\uFB04","\uFB05","\uFB06","\u0587","\uFB13",
                          "\uFB14","\uFB15","\uFB16","\uFB17","\u0149",
                          "\u0390","\u03B0","\u01F0","\u1E96","\u1E97",
                          "\u1E98","\u1E99","\u1E9A","\u1F50","\u1F52",
                          "\u1F54","\u1F56","\u1FB6","\u1FC6","\u1FD2",
                          "\u1FD3","\u1FD6","\u1FD7","\u1FE2","\u1FE3",
                          "\u1FE4","\u1FE6","\u1FE7","\u1FF6","\u1F80",
                          "\u1F81","\u1F82","\u1F83","\u1F84","\u1F85",
                          "\u1F86","\u1F87","\u1F88","\u1F89","\u1F8A",
                          "\u1F8B","\u1F8C","\u1F8D","\u1F8E","\u1F8F",
                          "\u1F90","\u1F91","\u1F92","\u1F93","\u1F94",
                          "\u1F95","\u1F96","\u1F97","\u1F98","\u1F99",
                          "\u1F9A","\u1F9B","\u1F9C","\u1F9D","\u1F9E",
                          "\u1F9F","\u1FA0","\u1FA1","\u1FA2","\u1FA3",
                          "\u1FA4","\u1FA5","\u1FA6","\u1FA7","\u1FA8",
                          "\u1FA9","\u1FAA","\u1FAB","\u1FAC","\u1FAD",
                          "\u1FAE","\u1FAF","\u1FB3","\u1FBC","\u1FC3",
                          "\u1FCC","\u1FF3","\u1FFC","\u1FB2","\u1FB4",
                          "\u1FC2","\u1FC4","\u1FF2","\u1FF4","\u1FB7",
                          "\u1FC7","\u1FF7","\u03A3"};
              String[] lower = {"\u00DF","\uFB00","\uFB01","\uFB02","\uFB03",
                          "\uFB04","\uFB05","\uFB06","\u0587","\uFB13",
                          "\uFB14","\uFB15","\uFB16","\uFB17","\u0149",
                          "\u0390","\u03B0","\u01F0","\u1E96","\u1E97",
                          "\u1E98","\u1E99","\u1E9A","\u1F50","\u1F52",
                          "\u1F54","\u1F56","\u1FB6","\u1FC6","\u1FD2",
                          "\u1FD3","\u1FD6","\u1FD7","\u1FE2","\u1FE3",
                          "\u1FE4","\u1FE6","\u1FE7","\u1FF6","\u1F80",
                          "\u1F81","\u1F82","\u1F83","\u1F84","\u1F85",
                          "\u1F86","\u1F87","\u1F80","\u1F81","\u1F82",
                          "\u1F83","\u1F84","\u1F85","\u1F86","\u1F87",
                          "\u1F90","\u1F91","\u1F92","\u1F93","\u1F94",
                          "\u1F95","\u1F96","\u1F97","\u1F90","\u1F91",
                          "\u1F92","\u1F93","\u1F94","\u1F95","\u1F96",
                          "\u1F97","\u1FA0","\u1FA1","\u1FA2","\u1FA3",
                          "\u1FA4","\u1FA5","\u1FA6","\u1FA7","\u1FA0",
                          "\u1FA1","\u1FA2","\u1FA3","\u1FA4","\u1FA5",
                          "\u1FA6","\u1FA7","\u1FB3","\u1FB3","\u1FC3",
                          "\u1FC3","\u1FF3","\u1FF3","\u1FB2","\u1FB4",
                          "\u1FC2","\u1FC4","\u1FF2","\u1FF4","\u1FB7",
                          "\u1FC7","\u1FF7","\u03C2"};
              String[] upper = {"\u0053\u0053","\u0046\u0046","\u0046\u0049","\u0046\u004C","\u0046\u0046\u0049",
                          "\u0046\u0046\u004C","\u0053\u0054","\u0053\u0054","\u0535\u0552","\u0544\u0546",
                          "\u0544\u0535","\u0544\u053B","\u054E\u0546","\u0544\u053D","\u02BC\u004E",
                          "\u0399\u0308\u0301","\u03A5\u0308\u0301","\u004A\u030C","\u0048\u0331","\u0054\u0308",
                          "\u0057\u030A","\u0059\u030A","\u0041\u02BE","\u03A5\u0313","\u03A5\u0313\u0300",
                          "\u03A5\u0313\u0301","\u03A5\u0313\u0342","\u0391\u0342","\u0397\u0342","\u0399\u0308\u0300",
                          "\u0399\u0308\u0301","\u0399\u0342","\u0399\u0308\u0342","\u03A5\u0308\u0300","\u03A5\u0308\u0301",
                          "\u03A1\u0313","\u03A5\u0342","\u03A5\u0308\u0342","\u03A9\u0342","\u1F08\u0399",
                          "\u1F09\u0399","\u1F0A\u0399","\u1F0B\u0399","\u1F0C\u0399","\u1F0D\u0399",
                          "\u1F0E\u0399","\u1F0F\u0399","\u1F08\u0399","\u1F09\u0399","\u1F0A\u0399",
                          "\u1F0B\u0399","\u1F0C\u0399","\u1F0D\u0399","\u1F0E\u0399","\u1F0F\u0399",
                          "\u1F28\u0399","\u1F29\u0399","\u1F2A\u0399","\u1F2B\u0399","\u1F2C\u0399",
                          "\u1F2D\u0399","\u1F2E\u0399","\u1F2F\u0399","\u1F28\u0399","\u1F29\u0399",
                          "\u1F2A\u0399","\u1F2B\u0399","\u1F2C\u0399","\u1F2D\u0399","\u1F2E\u0399",
                          "\u1F2F\u0399","\u1F68\u0399","\u1F69\u0399","\u1F6A\u0399","\u1F6B\u0399",
                          "\u1F6C\u0399","\u1F6D\u0399","\u1F6E\u0399","\u1F6F\u0399","\u1F68\u0399",
                          "\u1F69\u0399","\u1F6A\u0399","\u1F6B\u0399","\u1F6C\u0399","\u1F6D\u0399",
                          "\u1F6E\u0399","\u1F6F\u0399","\u0391\u0399","\u0391\u0399","\u0397\u0399",
                          "\u0397\u0399","\u03A9\u0399","\u03A9\u0399","\u1FBA\u0399","\u0386\u0399",
                          "\u1FCA\u0399","\u0389\u0399","\u1FFA\u0399","\u038F\u0399","\u0391\u0342\u0399",
                          "\u0397\u0342\u0399","\u03A9\u0342\u0399","\u03A3"};
              String[] errorChars = {"u00DF","uFB00","uFB01","uFB02","uFB03",
                          "uFB04","uFB05","uFB06","u0587","uFB13",
                          "uFB14","uFB15","uFB16","uFB17","u0149",
                          "u0390","u03B0","u01F0","u1E96","u1E97",
                          "u1E98","u1E99","u1E9A","u1F50","u1F52",
                          "u1F54","u1F56","u1FB6","u1FC6","u1FD2",
                          "u1FD3","u1FD6","u1FD7","u1FE2","u1FE3",
                          "u1FE4","u1FE6","u1FE7","u1FF6","u1F80",
                          "u1F81","u1F82","u1F83","u1F84","u1F85",
                          "u1F86","u1F87","u1F88","u1F89","u1F8A",
                          "u1F8B","u1F8C","u1F8D","u1F8E","u1F8F",
                          "u1F90","u1F91","u1F92","u1F93","u1F94",
                          "u1F95","u1F96","u1F97","u1F98","u1F99",
                          "u1F9A","u1F9B","u1F9C","u1F9D","u1F9E",
                          "u1F9F","u1FA0","u1FA1","u1FA2","u1FA3",
                          "u1FA4","u1FA5","u1FA6","u1FA7","u1FA8",
                          "u1FA9","u1FAA","u1FAB","u1FAC","u1FAD",
                          "u1FAE","u1FAF","u1FB3","u1FBC","u1FC3",
                          "u1FCC","u1FF3","u1FFC","u1FB2","u1FB4",
                          "u1FC2","u1FC4","u1FF2","u1FF4","u1FB7",
                          "u1FC7","u1FF7","u03A3"};
              String[] errorLower = {"u00DF","uFB00","uFB01","uFB02","uFB03",
                          "uFB04","uFB05","uFB06","u0587","uFB13",
                          "uFB14","uFB15","uFB16","uFB17","u0149",
                          "u0390","u03B0","u01F0","u1E96","u1E97",
                          "u1E98","u1E99","u1E9A","u1F50","u1F52",
                          "u1F54","u1F56","u1FB6","u1FC6","u1FD2",
                          "u1FD3","u1FD6","u1FD7","u1FE2","u1FE3",
                          "u1FE4","u1FE6","u1FE7","u1FF6","u1F80",
                          "u1F81","u1F82","u1F83","u1F84","u1F85",
                          "u1F86","u1F87","u1F80","u1F81","u1F82",
                          "u1F83","u1F84","u1F85","u1F86","u1F87",
                          "u1F90","u1F91","u1F92","u1F93","u1F94",
                          "u1F95","u1F96","u1F97","u1F90","u1F91",
                          "u1F92","u1F93","u1F94","u1F95","u1F96",
                          "u1F97","u1FA0","u1FA1","u1FA2","u1FA3",
                          "u1FA4","u1FA5","u1FA6","u1FA7","u1FA0",
                          "u1FA1","u1FA2","u1FA3","u1FA4","u1FA5",
                          "u1FA6","u1FA7","u1FB3","u1FB3","u1FC3",
                          "u1FC3","u1FF3","u1FF3","u1FB2","u1FB4",
                          "u1FC2","u1FC4","u1FF2","u1FF4","u1FB7",
                          "u1FC7","u1FF7","u03C2"};
              String[] errorUpper = {"u0053u0053","u0046u0046","u0046u0049","u0046u004C","u0046u0046u0049",
                          "u0046u0046u004C","u0053u0054","u0053u0054","u0535u0552","u0544u0546",
                          "u0544u0535","u0544u053B","u054Eu0546","u0544u053D","u02BCu004E",
                          "u0399u0308u0301","u03A5u0308u0301","u004Au030C","u0048u0331","u0054u0308",
                          "u0057u030A","u0059u030A","u0041u02BE","u03A5u0313","u03A5u0313u0300",
                          "u03A5u0313u0301","u03A5u0313u0342","u0391u0342","u0397u0342","u0399u0308u0300",
                          "u0399u0308u0301","u0399u0342","u0399u0308u0342","u03A5u0308u0300","u03A5u0308u0301",
                          "u03A1u0313","u03A5u0342","u03A5u0308u0342","u03A9u0342","u1F08u0399",
                          "u1F09u0399","u1F0Au0399","u1F0Bu0399","u1F0Cu0399","u1F0Du0399",
                          "u1F0Eu0399","u1F0Fu0399","u1F08u0399","u1F09u0399","u1F0Au0399",
                          "u1F0Bu0399","u1F0Cu0399","u1F0Du0399","u1F0Eu0399","u1F0Fu0399",
                          "u1F28u0399","u1F29u0399","u1F2Au0399","u1F2Bu0399","u1F2Cu0399",
                          "u1F2Du0399","u1F2Eu0399","u1F2Fu0399","u1F28u0399","u1F29u0399",
                          "u1F2Au0399","u1F2Bu0399","u1F2Cu0399","u1F2Du0399","u1F2Eu0399",
                          "u1F2Fu0399","u1F68u0399","u1F69u0399","u1F6Au0399","u1F6Bu0399",
                          "u1F6Cu0399","u1F6Du0399","u1F6Eu0399","u1F6Fu0399","u1F68u0399",
                          "u1F69u0399","u1F6Au0399","u1F6Bu0399","u1F6Cu0399","u1F6Du0399",
                          "u1F6Eu0399","u1F6Fu0399","u0391u0399","u0391u0399","u0397u0399",
                          "u0397u0399","u03A9u0399","u03A9u0399","u1FBAu0399","u0386u0399",
                          "u1FCAu0399","u0389u0399","u1FFAu0399","u038Fu0399","u0391u0342u0399",
                          "u0397u0342u0399","u03A9u0342u0399","u03A3"};
              for(int i = 0; i < chars.length; i++) {
                  if(!chars[i].toUpperCase().equals(upper[i])) {
                      System.out.println("Index : " + i + " ; Original string : " + errorChars[i] +
                              " ; Upper case string : " + errorUpper[i] + " ; We've got : " +
                              convertToUnicode(chars[i].toUpperCase()));
                      failed = true;
                  }
                  if(!chars[i].toLowerCase().equals(lower[i])) {
                      System.out.println("Index : " + i + " ; Original string : " + errorChars[i] +
                              " ; Lower case string : " + errorLower[i] + " ; We've got : " +
                              convertToUnicode(chars[i].toLowerCase()));
                      failed = true;
                  }
              }
              if(failed) {
                  System.out.println("incorrect case mapping");
                  return;
              }
              System.out.println("OKAY");
          }

          static String convertToUnicode(String str) {
              String result = "";
              for(int i = 0; i < str.length(); i++) {
                  result += "u" +
                      Integer.toHexString((int)str.charAt(i)).toUpperCase();
              }
              return result;
          }
      }
      ==================================================================
      ======================== log =====================================
      $ java -version
      java version "1.4.0-beta"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-beta-b51)
      Java HotSpot(TM) Client VM (build 1.4beta-B51, mixed mode)

      $ java -cp . test
      Index : 39 ; Original string : u1F80 ; Upper case string : u1F08u0399 ; We've got : u1F88
      Index : 40 ; Original string : u1F81 ; Upper case string : u1F09u0399 ; We've got : u1F89
      Index : 41 ; Original string : u1F82 ; Upper case string : u1F0Au0399 ; We've got : u1F8A
      Index : 42 ; Original string : u1F83 ; Upper case string : u1F0Bu0399 ; We've got : u1F8B
      Index : 43 ; Original string : u1F84 ; Upper case string : u1F0Cu0399 ; We've got : u1F8C
      Index : 44 ; Original string : u1F85 ; Upper case string : u1F0Du0399 ; We've got : u1F8D
      Index : 45 ; Original string : u1F86 ; Upper case string : u1F0Eu0399 ; We've got : u1F8E
      Index : 46 ; Original string : u1F87 ; Upper case string : u1F0Fu0399 ; We've got : u1F8F
      Index : 55 ; Original string : u1F90 ; Upper case string : u1F28u0399 ; We've got : u1F98
      Index : 56 ; Original string : u1F91 ; Upper case string : u1F29u0399 ; We've got : u1F99
      Index : 57 ; Original string : u1F92 ; Upper case string : u1F2Au0399 ; We've got : u1F9A
      Index : 58 ; Original string : u1F93 ; Upper case string : u1F2Bu0399 ; We've got : u1F9B
      Index : 59 ; Original string : u1F94 ; Upper case string : u1F2Cu0399 ; We've got : u1F9C
      Index : 60 ; Original string : u1F95 ; Upper case string : u1F2Du0399 ; We've got : u1F9D
      Index : 61 ; Original string : u1F96 ; Upper case string : u1F2Eu0399 ; We've got : u1F9E
      Index : 62 ; Original string : u1F97 ; Upper case string : u1F2Fu0399 ; We've got : u1F9F
      Index : 71 ; Original string : u1FA0 ; Upper case string : u1F68u0399 ; We've got : u1FA8
      Index : 72 ; Original string : u1FA1 ; Upper case string : u1F69u0399 ; We've got : u1FA9
      Index : 73 ; Original string : u1FA2 ; Upper case string : u1F6Au0399 ; We've got : u1FAA
      Index : 74 ; Original string : u1FA3 ; Upper case string : u1F6Bu0399 ; We've got : u1FAB
      Index : 75 ; Original string : u1FA4 ; Upper case string : u1F6Cu0399 ; We've got : u1FAC
      Index : 76 ; Original string : u1FA5 ; Upper case string : u1F6Du0399 ; We've got : u1FAD
      Index : 77 ; Original string : u1FA6 ; Upper case string : u1F6Eu0399 ; We've got : u1FAE
      Index : 78 ; Original string : u1FA7 ; Upper case string : u1F6Fu0399 ; We've got : u1FAF
      Index : 87 ; Original string : u1FB3 ; Upper case string : u0391u0399 ; We've got : u1FBC
      Index : 89 ; Original string : u1FC3 ; Upper case string : u0397u0399 ; We've got : u1FCC
      Index : 91 ; Original string : u1FF3 ; Upper case string : u03A9u0399 ; We've got : u1FFC
      Index : 102 ; Original string : u03A3 ; Lower case string : u03C2 ; We've got : u3C3
      incorrect case mapping
      ==================================================================


      ======================================================================

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                joconnersunw John Oconner (Inactive)
                Reporter:
                serjsunw Serj Serj (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: