From kaffe-core@rufus.w3.org  Mon Mar 29 15:55:43 1999
Date: Mon, 29 Mar 1999 15:02:53 +0200
From: "Edouard G. Parmelan" <egp@free.fr>
To: Kaffe Core Team <kaffe-core@rufus.w3.org>
Subject: Re: Kaffe Unicode Database

Hi,

I have finish it :)

Following, a tar ball with the new java.lang.Character, a FAQ.unicode that
explain the database, the database generator unicode.pl and the generated
database unicode.idx and unicode.tbl.

The inner class CharacterPropetries load the database with the native
method ClassLoader.getSystemResourceAsBytes0() in the same package.

The database files should be places in Klasses.jar under kaffe/lang/.

I don't change any Makefile.am to incorporate them :(


As promise, I run Mauve for java.lang.Character:

Mauve results for java.lang.Character: 156 of 3579141 tests failed

Let's me explain the 156 failed test:


getNumericValue test:

* FAIL: gnu.testlet.java.lang.Character.getNumericValue (number 6)
  It's getNumericValue('A'), see getNumericValue() in unicode test.


unicode test:

getNumericValue()

* 52 characters ``wrong numeric value''
  Mauve:
    It is not stated that A-Z and a-z should
    have getNumericValue() (as it is in digit())

  JDK1.2
    public static int getNumericValue(char ch)

    Returns the Unicode numeric value of the character as a nonnegative
    integer. If the character does not have a numeric value, then -1 is
    returned. If the character has a numeric value that cannot be
    represented as a nonnegative integer (for example, a fractional value),
    then -2 is returned.

  Kaffe
    as JDK1.2 says :)


isLowerCase()

* 68 characters ``incorrectly reported as lowercase''
* 1 character ``incorrectly reported as not-lowercase''
  Mauve
    // NOTE: JLS doesn't say anything about `Ll'
    // category.  And Unicode 2.1.8 has some
    // characters which might be considered
    // lowercase by all the other rules, but which
    // are not marked Ll -- e.g., 0x0345.  So we

  JDK1.2
    public static boolean isLowerCase(char ch)

    Determines if the specified character is a lowercase character.
    A character is lowercase if it is not in the range '\u2000'
    through '\u2FFF', the Unicode attribute table does not specify
    a mapping to lowercase for the character, and at least one of
    the following is true:

    + The attribute table specifies a mapping to uppercase for the character.
    + The name for the character contains the words "SMALL LETTER".
    + The name for the character contains the words "SMALL LIGATURE".

    A character is considered to be lowercase if and only if it is
    specified to be lowercase by the Unicode 2.0 standard (category
    "Ll" in the Unicode specification data file).

  Kaffe
    use the category "Ll".


isUpperCase()

* 31 characters ``incorrectly reported as uppercase''
  Mauve
    // NOTE: JLS doesn't say anything about `Lu'
    // category.  And Unicode 2.1.8 has some
    // characters which might be considered
    // uppercase by all the other rules, but which
    // are not marked Lu -- e.g., 0x03d2.  So we
    // don't check for this.

  JDK1.2
    public static boolean isUpperCase(char ch)

    Determines if the specified character is an uppercase character.
    A character is uppercase if it is not in the range '\u2000'
    through '\u2FFF', the Unicode attribute table does not specify
    a mapping to uppercase for the character, and at least one of
    the following is true:

    + The attribute table specifies a mapping to lowercase for the character.
    + The name for the character contains the words "CAPITAL LETTER".
    + The name for the character contains the words "CAPITAL LIGATURE".

  [ says nothing about category "Lu" in Unicode 2.0 :( ]
  
  Kaffe
    use category "Lu".


isWhitespace()

* 1 character ``incorrectly reported as not-whitespace''
  JDK1.2 says:
    + It is a Unicode space separator (category "Zs"), but is not a
      no-break space (\u00A0 or \uFEFF).

  In Unicode 2.1.8:
     U+00A0 Zs, noBreak
     U+2007 Zs, noBreak
  but
     U+FEFF Cf (Other, Format)

  Kaffe
    use category "Zs" and decomposition <noBreak> from Unicode 2.1.8


toTitleCase()

* 2 characters ``has wrong titlecase form''
  Mauve
    use the uppercase if the character don't have titlecase in
    the Unicode database.

  JDK1.2
    Converts the character argument to titlecase. A character has a
    titlecase equivalent if and only if a titlecase mapping is
    specified for the character in the Unicode attribute table.

    Note that some Unicode characters in the range '\u2000' through
    '\u2FFF' have titlecase mappings; this method does map such
    characters to their titlecase equivalents even though the
    method isTitleCase does not return true for such characters.

    There are only four Unicode characters that are truly titlecase
    forms that are distinct from uppercase forms. As a rule, if a
    character has no true titlecase equivalent but does have an
    uppercase mapping, then the Unicode 2.0 attribute table
    specifies a titlecase mapping that is the same as the uppercase
    mapping.

 Unicode 2.1.8
    U+0345 and U+1EFB don't have titlecase mapping.

 Kaffe
    return U+0000 for toTitleCase(U+0345) and toTitleCase(U+1EFB)


TODO:
Run mauve java.lang.Character with Sun JDK, as I don't have it any more,
I can't run it :(

Comments are welcome,
Edouard
-- 
Edouard G. Parmelan
http://egp.free.fr

From kaffe-core@rufus.w3.org Thu Apr 27 03:35:10 2000
Date: Thu, 27 Apr 2000 13:15:03 +0200
From: "Edouard G. Parmelan" <egp@free.fr>
To: kaffe-core@rufus.w3.org
Subject: Re: unicode.pl

Archie L. Cobbs wrote:

> Where is the input file that unicode.pl reads? 

Humm, I will add some comments in it and in README.unicode.

It use UnicodeData.txt file from ftp://ftp.unicode.org/Public/UNIDATA or
ftp://ftp.unicode.org/Public/*-Update/UnicodeData-*.txt

Hope this helps.
-- 
Edouard G. Parmelan
http://egp.free.fr
