[regex] Optimize UTF-8 and ASCII-superset character sets outside _glibc

Bonzini Paolo paolo.bonzini@lu.unisi.ch
Wed Oct 27 13:45:00 GMT 2004


This patch optimizes UTF-8 regexps even if !_LIBC.  Support for this feature outside glibc was requested to replace the old (NFA) regex in gnulib.

The most important ASCII supersets are recognized, including Windows/AIX codepages, EUC, GB2312, ISO-8859, and UTF-8.  The code translates between the canonical names maintained in glibc and the names used in other OSes, based on the code in gettext's config.charset and localcharset.c files.  I did not want to encumber regex users with the need to distribute and install additional files, so I rewrote the code. I made it thread-safe along the way.

Hand-tested with sed on several configurations and locales, checking that optimize_utf8 is called when needed and that map_notascii is reset.  Ok?

Paolo

-------------- next part --------------
A non-text attachment was scrubbed...
Name: recognize-utf8-and-ascii-outside-glibc.patch
Type: text/x-patch
Size: 7114 bytes
Desc: recognize-utf8-and-ascii-outside-glibc.patch
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20041027/db4e26ec/attachment.bin>


More information about the Libc-alpha mailing list