This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: [regex] Optimize UTF-8 and ASCII-superset character sets outside _glibc
- From: Bruno Haible <bruno at clisp dot org>
- To: libc-alpha at sources dot redhat dot com
- Date: Thu, 28 Oct 2004 22:58:55 +0200
- Subject: Re: [regex] Optimize UTF-8 and ASCII-superset character sets outside _glibc
Paolo Bonzini writes:
> /* Most systems support nl_langinfo (CODESET) nowadays. */
> /* On old systems we use getenv. This includes FreeBSD, so we need it. */
FreeBSD has nl_langinfo (CODESET) now. But OpenBSD and NetBSD still lack it.
> locale = getenv ("LANG");
> locale = strchr (locale, '.');
Calling strchr (NULL, '.') will crash.
> Windows codepages (including CP932 SHIFT-JIS) ... supersets of ASCII. */
This is not true. In particular, SHIFT_JIS maps 0x5C to U+00A5 and
0x7E to U+203E (see localedata/charmaps/SHIFT_JIS).
Also, various CP and IBM codepages are EBCDIC compatible, not supersets of
ASCII. Therefore I'd recommend to list the good known CP* encodings explicitly.
Bruno