From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp1.rz.uni-karlsruhe.de (Debian-exim@smtp1.rz.uni-karlsruhe.de [129.13.185.217]) by krisdoz.my.domain (8.14.3/8.14.3) with ESMTP id o78IqnEu011153 for ; Sun, 8 Aug 2010 14:52:51 -0400 (EDT) Received: from hekate.usta.de (asta-nat.asta.uni-karlsruhe.de [172.22.63.82]) by smtp1.rz.uni-karlsruhe.de with esmtp (Exim 4.63 #1) id 1OiAzH-0002s7-SD; Sun, 08 Aug 2010 20:52:47 +0200 Received: from donnerwolke.usta.de ([172.24.96.3]) by hekate.usta.de with esmtp (Exim 4.71) (envelope-from ) id 1OiAzH-0000tW-RI for tech@mdocml.bsd.lv; Sun, 08 Aug 2010 20:52:47 +0200 Received: from hera.usta.de ([172.24.64.3]) by donnerwolke.usta.de with esmtp (Exim 4.69) (envelope-from ) id 1OiAzH-0000V3-QB for tech@mdocml.bsd.lv; Sun, 08 Aug 2010 20:52:47 +0200 Received: from schwarze by hera.usta.de with local (Exim 4.72) (envelope-from ) id 1OiAzH-0007Jr-DQ for tech@mdocml.bsd.lv; Sun, 08 Aug 2010 20:52:47 +0200 Date: Sun, 8 Aug 2010 20:52:46 +0200 From: Ingo Schwarze To: tech@mdocml.bsd.lv Subject: Re: Non-ASCII check fails in main.c on OpenBSD Message-ID: <20100808185246.GB28837@usta.de> References: <20100808124704.GC17816@iris.usta.de> <20100808153928.GA21155@britannica.bec.de> X-Mailinglist: mdocml-tech Reply-To: tech@mdocml.bsd.lv MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100808153928.GA21155@britannica.bec.de> User-Agent: Mutt/1.5.20 (2009-06-14) Hi Joerg, thanks for your hint. Joerg Sonnenberger wrote on Sun, Aug 08, 2010 at 05:39:28PM +0200: > On Sun, Aug 08, 2010 at 02:47:04PM +0200, Ingo Schwarze wrote: >> Now maybe that's a bug in OpenBSD isgraph(3), maybe it is not and >> isgraph(3) behaves like it does on purpose - actually, i don't really >> care that much either way, and i doubt that it will be easy to get >> OpenBSD isgraph(3) changed. > Didn't OpenBSD have some "default locale == ISO 8859-1" hack Maybe, no idea. As i said, i don't care about locales and never change the defaults. Hmmm, but at least i should understand what we are doing in mandoc. The test program appended below gives me 1 1 on OpenBSD 0 1 on Linux I guess Linux is correct. > I'm reasonable sure that such behavior violates the > definition of the C locale. That statement seems to make sense to me. So, no matter what we think about OpenBSD's behaviour in this respect, i think the patch i committed to explicitely call isascii() is correct: We certainly don't want any of mandoc's behaviour to depend on whatever the user may have chosen as a locale. Yours, Ingo #include #include #include int main() { setlocale(LC_CTYPE, "C"); printf("%i\n", !!isgraph(228)); setlocale(LC_CTYPE, "de_DE.ISO8859-1"); printf("%i\n", !!isgraph(228)); return 0; } -- To unsubscribe send an email to tech+unsubscribe@mdocml.bsd.lv