Path: utzoo!utgpu!cunews!cognos!jimp From: jimp@cognos.UUCP (Jim Patterson) Newsgroups: comp.lang.c Subject: Re: Is there a good example of how toupper() works? Keywords: converting upper/lower case macros Message-ID: <9018@cognos.UUCP> Date: 8 Nov 90 19:39:25 GMT References: <1990Oct17.170914.683@wpi.WPI.EDU> <11021@hubcap.clemson.edu> <152580@felix.UUCP> <1990Nov7.043705.15051@robot.in-berlin.de> Reply-To: jimp@cognos.UUCP (Jim Patterson) Organization: Cognos Inc., Ottawa, Canada Lines: 27 In article <1990Nov7.043705.15051@robot.in-berlin.de> karl@robot.in-berlin.de (Karl-P. Huestegge) writes: >asylvain@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