Ah yes, you're right—I was getting wrapped up in the various definitions. In that case, it looks like the derived "Lowercase" and "Uppercase" property would directly give us what we want for scalars and single-scalar characters.
AFAIK, this is where the Default Case Detection rules in 3.13 come in. So to try to restate everything:
-
For
Unicode.Scalar
s andCharacter
s consisting of a singleUnicode.Scalar
or consisting of multiple scalars that are canonically equivalent to a single scalar,isLowercase
equals the value of the single scalar's derivedLowercase
property. -
For
Character
s consisting of multiple scalars that are not canonically equivalent to a single scalar, thenisLowercased
is true if and only ifC == toLowercase(C) && isCased(C)
.
Case #1 is really a subset of case #2, but it presents an optimization opportunity for single scalars where we don't have to compute a temporary mapping and test equality. Overall, this behavior is consistent with what's described by 3.13 and produces the correct results for something like "a + several combining accents" (where isCased
keeps it true) and for emoji sequences where isCased
would be false, therefore saying the whole cluster is false.
How does that sound?