Re: When does toUpperCase(ch) == ch ?

From: Mark Davis (mark@macchiato.com)
Date: Tue Oct 10 2000 - 04:19:14 EDT


In general, you can't depend on any of the following:

toUppercase(x) == x iff Cat(x) == Lu
toTitlecase(x) == x iff Cat(x) == Lt
toLowercase(x) == x iff Cat(x) == Ll

There are counterexamples to these, even using the simple 1-1 mappings. Take
a look at the casing charts, at
http://www.unicode.org/unicode/reports/tr21/charts/

And of course they are definitely not true once you add the complete
mappings from SpecialCasing.txt (which you have to have for correct casing),
and include the locale-dependent mappings (such as for Turkey). Look at
http://www.unicode.org/unicode/reports/tr21/

Mark
----- Original Message -----
From: "John O'Conner" <john.oconner@eng.sun.com>
To: "Unicode List" <unicode@unicode.org>
Sent: Monday, October 09, 2000 23:40
Subject: When does toUpperCase(ch) == ch ?

> I intend on testing this with a few perl scripts later using the db, but
> thought I'd pose the question to see if anyone has a quick answer:
>
> Is it true that if a character's general category is neither Ll nor Lt,
> then the uppercase character is simply the character itself?
>
> Regards,
> John O'Conner
>
>



This archive was generated by hypermail 2.1.2 : Tue Jul 10 2001 - 17:21:14 EDT