[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH] ctype.h




On 20 Dec 2005, at 03:31, Rusty Russell wrote:

While writing the unit tests for xen/common/lib.c, I found a bug in
islower and isupper.  Character 223 ('ß') should not become 255 ('ÿ')
when lower-cased, or vice versa.  ISO C says in the C locale, nothing
above 127 should be upper or lower case.  However, it's not completely
useless to regard these characters as iso_8859-1, which seems to be the
intent.  Either way, if (islower(c)), then isupper(toupper(c)) must be
true. This is fixed by regarding both 223 and 255 as alpha, but neither
upper nor lower.  We have to use both bits, since all 8 bits are taken.

If it gets fixed in Linux, which is where I pulled that code from originally, then I'll pull down a new copy into Xen. I think it's safe to say right now that no caller in Xen is depending on getting an ISO-mandated result from isupper/islower on chars with the msb set. Maybe when the i18n project for the hypervisor kicks off... ;-)

 -- Keir


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.