tech-pkg archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: chat/pidgin segfault with NetBSD 11 (fixed)
> Date: Sun, 5 Oct 2025 18:02:14 +0200
> From: Thomas Klausner <wiz%gatalith.at@localhost>
> 
> On Sun, Oct 05, 2025 at 03:38:16PM +0100, Anthony Mallet wrote:
> > 
> > I attach a tarball for chat/libpurple with a set of patches
> > that fix ctype(3) usage, as well as the distinfo diff just for the
> > sake of it. They've got a mixed use of ctype(3) functions
> > and similar glib functions (e.g. g_ascii_isspace). The latter are
> > documented to _NOT_ take into account the locale setting.
> 
> Neither does ctype(3).
No, ctype(3) does respect the locale, via LC_CTYPE (defaulting to
LANG, overridden by LC_ALL, as usual).
It's not very _useful_ because it's limited to 8-bit character sets;
for, e.g., Unicode input you need to use the wide variants like
iswspace(3).
But it does respect the locale, so that, e.g.,
	isprint(255)
returns a different answer before and after
	setlocale(LC_CTYPE, "fr_FR.ISO8859-1")
because in ISO-8859-1, code point 255 is LATIN SMALL LETTER Y WITH
DIAERESIS.  (In contrast, isspace(256) is undefined, to jklos's
chagrin in the other thread.)
Home |
Main Index |
Thread Index |
Old Index