[Bug 1850] [F&O] how do ranges work in case-insensitive mode?

http://www.w3.org/Bugs/Public/show_bug.cgi?id=1850





------- Additional Comments From mike@saxonica.com  2005-08-31 14:43 -------
Here are some observations from Java:

(a) it appears that a character matches a range if any case-variant of the
character matches the range:

   matches("D", "[A-Z]", "i")  = true
   matches("d", "[A-Z]", "i")  = true

(b) this rule also works for subtractions:

   matches("D", "[A-Z-[D]]", "i")  = true
   matches("d", "[A-Z-[D]]", "i")  = true

(c) the rule doesn't work for negative character groups. Here it appears that ^d
removes both "d" and "D" from the group (whereas the rule above would suggest
that it removes neither)

   matches("D", "[^d]", "i")  = false
   matches("d", "[^d]", "i")  = false

(d) it appears that the "i" flag has no effect on character blocks. 

   matches("D", "\p[Lu]", "i") = true;
   matches("d", "\p[Lu]", "i") = false;
   matches("D", "\P[Lu]", "i") = false;
   matches("d", "\P[Lu]", "i") = true;

This is a terribly empirical way of approaching a specification!

Received on Wednesday, 31 August 2005 14:44:21 UTC