From owner-freebsd-stable Sun Jan 9 21:14:50 2000 Delivered-To: freebsd-stable@freebsd.org Received: from smtp1.vnet.net (smtp1.vnet.net [166.82.1.31]) by hub.freebsd.org (Postfix) with ESMTP id 25B0B151F9 for ; Sun, 9 Jan 2000 21:14:48 -0800 (PST) (envelope-from rivers@dignus.com) Received: from dignus.com (ponds.vnet.net [166.82.177.48]) by smtp1.vnet.net (8.9.1a/8.9.1) with ESMTP id AAA16940; Mon, 10 Jan 2000 00:12:52 -0500 (EST) Received: from lakes.dignus.com (lakes.dignus.com [10.0.0.3]) by dignus.com (8.9.2/8.8.5) with ESMTP id AAA00461; Mon, 10 Jan 2000 00:13:03 -0500 (EST) Received: (from rivers@localhost) by lakes.dignus.com (8.9.3/8.6.9) id AAA34272; Mon, 10 Jan 2000 00:12:50 -0500 (EST) Date: Mon, 10 Jan 2000 00:12:50 -0500 (EST) From: Thomas David Rivers Message-Id: <200001100512.AAA34272@lakes.dignus.com> To: mi@kot.ne.mediaone.net, stable@FreeBSD.ORG Subject: Re: isprint(3) and LANG/LOCALE In-Reply-To: <200001100505.AAA86278@rtfm.newton> Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > > 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 > #include > > 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