Newsgroups: comp.lang.c Path: utzoo!henry From: henry@utzoo.uucp (Henry Spencer) Subject: Re: isascii (was: Another pitfall. Signed chars and ctype.h) Message-ID: <1990Feb28.190829.28985@utzoo.uucp> Organization: U of Toronto Zoology References: <1990Feb12.043324.5259@sq.sq.com> <2448@ditsyda.oz> <34540@watmath.waterloo.edu> <668@mwtech.UUCP> Date: Wed, 28 Feb 90 19:08:29 GMT In article <668@mwtech.UUCP> martin@mwtech.UUCP (Martin Weitzel) writes: >As much as *I* understand ANSI-C, all characters of the "machine >character set" must have positive values. So IMHO problems with >isdigit() and the other -stuff can only occur, > >- if the compiler claims (only) to support ASCII, >- but you in fact use it for non-ASCII (eg ISO 8859). Sorry, not so. The ANSI C restriction is weaker than that found in earlier C documentation: it says that the characters in the "source character set" -- roughly speaking, the characters used to write C -- must be positive. There is no promise made about other characters in your machine's character set. Various things in the standard encourage implementors to make char unsigned, but it is not actually compulsory even if you have an 8-bit character set. -- "The N in NFS stands for Not, | Henry Spencer at U of Toronto Zoology or Need, or perhaps Nightmare"| uunet!attcan!utzoo!henry henry@zoo.toronto.edu