This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]