Path: utzoo!attcan!uunet!mcsun!unido!kivax!web From: web@kivax.UUCP (Heinz Weber) Newsgroups: comp.lang.c Subject: Re^2: Another pitfall. Signed chars and ctype.h. Message-ID: <592@kivax.UUCP> Date: 13 Feb 90 07:21:25 GMT References: <11957@frog.UUCP> Organization: MANNESMANN KIENZLE W-GERMANY Lines: 33 john@frog.UUCP (John Woods) writes: >In article , flee@shire.cs.psu.edu (Felix Lee) writes: >> If you have "char * s;" you cannot say something like "isdigit(*s)" if >> you want to be 8-bit clean. "isdigit" etc. take an (int) in the range >> [-1, UCHAR_MAX]. >> You have to say "isdigit((unsigned char) *s)". >You have ahold of the wrong end of the stick. >You have to say > isascii(*s) && isdigit(*s) >isdigit() and friends are all only defined on those values for which >isascii() is true. You are right, this is what's defined in the X/OPEN Portability Guide. But you don't meet the problem. I want German Umlauts to be no space char's and printable an so on, e.g. the german "oe", that is 0xf6 in the international char set. I'm not interested in isascii(0xf6) = not true! So, the only chance you have is to take unsigned char to get the right index into the ctype-vector. Heinz ------------------------------------------------------------------------ Heinz Weber voice: +49 7721 867034 * In all probability Mannesmann Kienzle GmbH * this is once again Abt. 013.21 e-mail: web@kivax.UUCP * only my opinion ! Postfach 1640 ..!mcsun!unido!kivax!web D-7730 VS-Villingen ..!uunet!unido!kivax!web West Germany