Is there a good example of how toupper() works?

Jim Patterson jimp at cognos.UUCP
Fri Nov 9 06:39:25 AEST 1990


In article <1990Nov7.043705.15051 at robot.in-berlin.de> karl at robot.in-berlin.de (Karl-P. Huestegge) writes:
>asylvain at felix.UUCP (Alvin "the Chipmunk" Sylvain) writes:
>
>>Conclusion: If there is a standard routine that does what you want, *use it*.
>>This increases reliability and portability and reduces debug time.
>
>There is another reason to use the standard library functions:
>The international Charactersets (8bit, ISO-8859-1 for example). On my
>international development system toupper('a-umlaut') is ('A-umlaut'),
>which is of course *not* 'a-umlaut'-32 or ('a-umlaut' - 'a'-'A').
>The functions accesses a library of the local language-set (depending
>on the environment-var LC_CTYPE)

You're fortunate to be working on a system that's "working" in this
regard.  We at one point abandoned the vendor's ctype.h functions
because they simply ignored 8-bit character sets. It wouldn't have
been so bad if they just considered the extended characters as
graphics or something, but in fact the functions were implemented with
128-byte tables so anything with the 8th bit set returned arbitrary
results. I won't mention the vendor since they have since put in very
good internationalization support, but I suspect this sort of problem
is present in a number of older implementations.
-- 
Jim Patterson                              Cognos Incorporated
UUCP:uunet!mitel!cunews!cognos!jimp        P.O. BOX 9707    
PHONE:(613)738-1440                        3755 Riverside Drive
NOT a Jays fan (not even a fan)            Ottawa, Ont  K1G 3Z4



More information about the Comp.lang.c mailing list