This is the mail archive of the libc-alpha@sourceware.org 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: [PATCH v2] Improve fnmatch performance.


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.


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