[klibc] Question about islower() in ctype.h (ANSI compat headers test)

Martin Schlemmer azarah at nosferatu.za.org
Mon Mar 7 13:47:49 PST 2005


On Mon, 2005-03-07 at 13:36 -0800, H. Peter Anvin wrote:
> Martin Schlemmer wrote:
> > Hi,
> > 
> > So far with the latest changes the projects I am trying to port works
> > fine, except for a mismatch on what is considered the ansi behaviour of
> > islower() in ctype.h:
> > 
> > -----
> > i = 220
> > islower (i) = 0, ISLOWER (i) = 0
> > toupper (i) = 220, TOUPPER (i) = 220
> > i = 221
> > islower (i) = 0, ISLOWER (i) = 0
> > toupper (i) = 221, TOUPPER (i) = 221
> > i = 222
> > islower (i) = 0, ISLOWER (i) = 0
> > toupper (i) = 222, TOUPPER (i) = 222
> > i = 223
> > islower (i) = 2, ISLOWER (i) = 0
> > toupper (i) = 223, TOUPPER (i) = 223
> > No Match!
> > nosferatu 1.0.0.rc6.klibc4 # cat foo.c
> > /* confdefs.h.  */
> > 
> 
> man iso-8859-1
> 
>         337   223   DF      ??     LATIN SMALL LETTER SHARP S
> 
> UnicodeData.txt
> 
> 00DF;LATIN SMALL LETTER SHARP S;Ll;0;L;;;;;N;;German;;;
> 
> (meaning: lower case, no upper case equivalent)
> 
> Your ISLOWER() is broken and only applies to ASCII, so using it in the 
> range > 127 is just crap.
> 

Not mine, the one from autoconf's AC_HEADER_STDC check :)

> I chose to implement iso-8859-1 as a reasonable default for > 127, 
> although one could argue that since the only thing one can rely upon is 
> ASCII, I should just have stuck to it.
> 

Ok, that was why I asked, as not sure if it might be an implementation
issue ...


Thanks,
-- 
Martin Schlemmer



-- 
---------------------[ Ciphire Signature ]----------------------
From: azarah at nosferatu.za.org signed email body (1078 characters)
Date: on 07 March 2005 at 21:44:50 UTC
To:   hpa at zytor.com, klibc at zytor.com
----------------------------------------------------------------
: Ciphire has secured this email against identity theft.
: Free download at www.ciphire.com. The garbled lines
: below are the sender's verifiable digital signature.
----------------------------------------------------------------
00fAAAAAEAAABSyyxCNgQAAEICAAIAAgACACAjYe/qeWoHRrdDE3mOifT0WPgp92
kbkclxgX1lQsV9VwEAJOQiG+Djg3e7Ai63e8AMF0Hl/gle8q4Ud88Lecx5fcUUzB
zjfhMM01dpFXq02kNCt8KCIXWWtgleSYUp7n2LVA==
------------------[ End Ciphire Signed Message ]----------------



More information about the klibc mailing list