Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 11 Jan 2000 12:03:14 +0600 (NS)
From:      Max Khon <fjoe@iclub.nsu.ru>
To:        Mikhail Teterin <mi@kot.ne.mediaone.net>
Cc:        obrien@FreeBSD.ORG, ache@FreeBSD.ORG, stable@FreeBSD.ORG
Subject:   Re: isprint(3) and LANG/LOCALE
Message-ID:  <Pine.BSF.4.21.0001111157380.92609-100000@iclub.nsu.ru>
In-Reply-To: <200001110507.AAA90968@rtfm.newton>

next in thread | previous in thread | raw e-mail | index | archive | help
hi, there!

On Tue, 11 Jan 2000, Mikhail Teterin wrote:

> =>Is the  subject supposed to consider  the LANG setting? I'd  think so,
> =>but
> =>
> =I would email ache@freebsd.org as he is our internationalization guy.
> 
> Is not he reading -stable?
> 
> =Possibly putting calls to setlocale() in main() will help.
> 
> Does not appear to change the result of this little program...
> 
> 	-mi
> 
> #include <stdio.h>
> #include <ctype.h>
> 
> #include <locale.h>
> 
> main(int argc, char *argv[]) {
> 	char *c;
> 	setlocale(LC_ALL, "");
> 	for(c = argv[argc-1]; *c; *c++)
> 		printf("for %c isprint() returns %d\n", *c, isprint(*c));
> }

char is signed. you should use 'unsigned char *c' for isprint to work
with chars > 127
this happens because _BSD_CT_RUNE_T_ is #define'ed as 'int' (is signed)
in machine/ansi.h
possibly this should be changed to int. ask ache about it.

/fjoe



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-stable" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0001111157380.92609-100000>