From: Ingo Schwarze <schwarze@usta.de>
To: tech@mdocml.bsd.lv
Subject: Re: Non-ASCII check fails in main.c on OpenBSD
Date: Sun, 8 Aug 2010 20:52:46 +0200 [thread overview]
Message-ID: <20100808185246.GB28837@usta.de> (raw)
In-Reply-To: <20100808153928.GA21155@britannica.bec.de>
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 <ctype.h>
#include <locale.h>
#include <stdio.h>
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
next prev parent reply other threads:[~2010-08-08 18:52 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-08 12:47 Ingo Schwarze
2010-08-08 14:27 ` Kristaps Dzonsons
2010-08-08 15:39 ` Joerg Sonnenberger
2010-08-08 18:52 ` Ingo Schwarze [this message]
2010-08-11 16:34 ` Ulrich Spörlein
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100808185246.GB28837@usta.de \
--to=schwarze@usta.de \
--cc=tech@mdocml.bsd.lv \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).