Hi Paul,

> See glibc bug 19932:
> https://sourceware.org/bugzilla/show_bug.cgi?id=19932

Thanks for mentioning this. It's a hairy issue to change the behaviour of
something as basic as the C locale, 15 years after glibc is in wide use.

> +# if C_LOCALE_MAYBE_EILSEQ
> +  if ((size_t) -2 <= ret && n != 0 && ! hard_locale (LC_CTYPE))

The function hard_locale is quite slow, as it calls setlocale(),
strdup(), and similar functions. rpl_mbrtowc is supposed to be fast,
as it's called once on every character in a string. Can't you get
away without the call to hard_locale?

Bruno


Reply via email to