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

Inaccurate specification for Character.toTitleCase(ch)

XMLWordPrintable

    • generic
    • generic



      Name: ooR10006 Date: 01/04/2001


      jdk1.4.0beta-b45 API specification for the method Character.toTitleCase(ch)
      is inaccurate. It states:
      "public static char toTitleCase(char ch)
      Converts the character argument to titlecase using case mapping information from
      the UnicodeData file. If a character has no explicit titlecase mapping according to
      UnicodeData, then the uppercase mapping is returned as an equivalent titlecase mapping."

      This is incorrect algorithm for those chars of Unicode category "Lt" which are
      titlecase chars themselves but also have uppercase mappings that differ
      from the char's codepoints.
      For example, for the following chars Unicode3.0.0 defines:

      CODEPOINT UPPER_CASE LOWER_CASE TITLE_CASE CATEGORY
       0x01C5 0x01C4 0x01C6 no "Lt"
       0x01C8 0x01C7 0x01C9 no "Lt"
       0x01CB 0x01CA 0x01CC no "Lt"
       0x01F2 0x01F1 0x01F3 no "Lt"

      Following the specified algorithm Character.toTitleCase((char)0x01C5) should return
      0x01C4, but in fact jdk1.4.0beta-b45 Character.toTitleCase((char)0x01C5) returns
      correct 0x01C5.

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

            joconnersunw John Oconner (Inactive)
            ovosunw Ovo Ovo (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: