[regex] BZ #522 Enable UTF-8 and ASCII optimizations outside glibc, take 2
Paolo Bonzini
paolo.bonzini@lu.unisi.ch
Mon Nov 8 10:11:00 GMT 2004
This is a simpler version of the patch I submitted on October 27. It
avoids reimplementing locale_charset, because the only charset name it
has to check against is UTF-8: the four possibilities UTF-8, UTF8, utf-8
and utf8 should cover most OSes, and were anyway the same that the
bigger patch covered.
This patch avoids checking against a list of known ASCII-superset
character sets, because I think it is enough to check that "btowc (x) ==
(wchar_t) x" for 0<=x<=127. We already have a loop executing btowc 256
times, so the cost of this additional, more robust check is small.
As I told Bruno in private mail, I'm quite reluctant to make sed
slower/faster depending on the presence of a file other than /bin/sed,
so using localcharset.c is not my favorite option. Bruno, are you ok
with this (or do you dislike it less)?
Paolo
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 01-recognize-utf8-and-ascii-outside-glibc-take2.patch
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20041108/8b20b40b/attachment.ksh>
More information about the Libc-alpha
mailing list