[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] mbrtowc: work around glibc bug#19932
From: |
Bruno Haible |
Subject: |
Re: [PATCH] mbrtowc: work around glibc bug#19932 |
Date: |
Sat, 09 Apr 2016 18:47:20 +0200 |
User-agent: |
KMail/4.8.5 (Linux/3.8.0-44-generic; KDE/4.8.5; x86_64; ; ) |
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