This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH v2] Improve fnmatch performance.
- From: Paul Eggert <eggert at cs dot ucla dot edu>
- To: OndÅej BÃlka <neleai at seznam dot cz>, libc-alpha at sourceware dot org
- Date: Wed, 13 May 2015 09:48:27 -0700
- Subject: Re: [PATCH v2] Improve fnmatch performance.
- Authentication-results: sourceware.org; auth=none
- References: <20150512235339 dot GA27716 at domone>
OndÅej BÃlka wrote:
How to synchronize this with gnulib? Only implementation specific detail
is utf8 detection.
It could be something like this:
#if _LIBC
struct __locale_data *current = _NL_CURRENT_LOCALE->__locales[LC_COLLATE];
uint_fast32_t encoding =
current->values[_NL_ITEM_INDEX (_NL_COLLATE_ENCODING_TYPE)].word;
bool is_utf8 = encoding == !__cet_other;
#else
bool is_utf8 = STRCASEEQ (locale_charset (),
"UTF-8", 'U','T','F','-','8',0,0,0,0)
#endif
We should package this sort of thing up and make it easier to use, but that
could be another day.