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

String.toUpperCase() behaves incorrect for single "ß"

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: P4 P4
    • None
    • 1.4.2
    • core-libs
    • x86
    • windows_2000



      Name: rmT116609 Date: 08/05/2003


      FULL PRODUCT VERSION :
      java version "1.4.2"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2-b28)
      Java HotSpot(TM) Client VM (build 1.4.2-b28, mixed mode)

      FULL OS VERSION :
      Microsoft Windows 2000 [Version 5.00.2195]

      EXTRA RELEVANT SYSTEM CONFIGURATION :
      German Locale

      A DESCRIPTION OF THE PROBLEM :
      String.toUpperCase() usually converts "ß" in a String to "SS" (Like "Muß" -> "MUSS"). When given a single character String "ß", the conversion fails ("ß" -> "ß").
      Also Character.toUpperCase() has a signature (char) that does not allow to return multiple characters as the upper case version of a single character.
      Maybe you should just keep "ß" everytime (makes no real difference for a german user anyway ...).

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Call test program (see below)

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Expected output:

      1.3.1_06
      ß
      ß
      MUSS DAS SEIN ?
      SS
      muß das sein ?
      ß
      ACTUAL -
      Actual output:

      1.3.1_06
      ß
      ß
      MUSS DAS SEIN ?
      ß
      muß das sein ?
      ß


      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      public class Test
      {
      public static void main(String[] args)
      {
      System.out.println(System.getProperty("java.version")) ;
      System.out.println(Character.toLowerCase('\u00df')) ;
      System.out.println(Character.toUpperCase('\u00df')) ;
      System.out.println("Mu\u00df das sein ?".toUpperCase()) ;
      System.out.println("\u00df".toUpperCase()) ;
      System.out.println("Mu\u00df das sein ?".toLowerCase()) ;
      System.out.println("\u00df".toLowerCase()) ;
      }
      }
      ---------- END SOURCE ----------
      (Incident Review ID: 193363)
      ======================================================================

            nlindenbsunw Norbert Lindenberg (Inactive)
            rmandalasunw Ranjith Mandala (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: