I've just been looking through fl_utf8.cxx and came across:
/*
* return 0 if the strings are equal;
* return 1 if s1 is greater than s2
* return -1 if s1 is less than s2
*/
int fl_utf_strcasecmp(const char *s1, const char *s2)
{
int s1_l = strlen(s1);
int s2_l = strlen(s2);
if (s1_l < s2_l) {
return -1;
} else if (s1_l > s2_l) {
return 1;
}
return fl_utf_strncasecmp(s1, s2, s1_l);
}
My brain is hurting after trying to make sense of various dry
documents about UTF-8 on the Wikipedia and elsewhere such as
http://www.cl.cam.ac.uk/~mgk25/unicode.html. It's late and way
past my bedtime, so I should probably leave this well alone...
but, am I right in thinking that the code above would say that
the string "z" is "less" than "aa" because it is shorter?
If so, something doesn't make sense, or am I missing something?
I'm too tired to think any more.
D.
_______________________________________________
fltk-dev mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-dev