Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 10 Jan 2000 00:12:50 -0500 (EST)
From:      Thomas David Rivers <rivers@dignus.com>
To:        mi@kot.ne.mediaone.net, stable@FreeBSD.ORG
Subject:   Re: isprint(3) and LANG/LOCALE
Message-ID:  <200001100512.AAA34272@lakes.dignus.com>
In-Reply-To: <200001100505.AAA86278@rtfm.newton>

next in thread | previous in thread | raw e-mail | index | archive | help
> 
> Is the subject supposed to consider  the LANG setting? I'd think so, but
> it does not :(  Send-pr? I have a bunch of  jpeg-images with comments in
> Russian. rdjpeg(1)  reads them,  but because  isprint(3) says  0, prints
> every character's octal value :(. Thanks!
> 
> 	-mi
> 
> #include <stdio.h>
> #include <ctype.h>
> 
> main(int argc, char *argv[]) {
> 	char *c;
> 	for(c = argv[argc-1]; *c; *c++)
> 		printf("for %c isprint() returns %d\n", *c, isprint(*c));
> }
> 

 As you point out, the isprint(3) man page seems to suggest it does not
 check lang - isprint simply looks at the byte and decides if it's printable
 in the ASCII char set.

 The man page basically quotes the C ANSI standard and says isprint() 
 tests for any printing character.  The ANSI standard doesn't appear to
 go beyond that.

 Perhaps the best thing to do would be to remove the test in rdjpeg???

	- Dave Rivers -


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?200001100512.AAA34272>