From: Bruno Haible Date: Sun, 30 Mar 2008 16:56:58 +0000 (+0200) Subject: Optimize conversion from UTF-8 to UTF-8//TRANSLIT. X-Git-Tag: v0.1~7631^2~1 X-Git-Url: http://erislabs.org.uk/gitweb/?a=commitdiff_plain;h=38f9d6311a396cc851ee075124188fed64cdbefa;p=gnulib.git Optimize conversion from UTF-8 to UTF-8//TRANSLIT. --- diff --git a/ChangeLog b/ChangeLog index 76a695ff2..5df926741 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2008-03-30 Bruno Haible + * lib/striconveh.h (mem_iconveh, str_iconveh): Optimize the conversion + from UTF-8 to UTF-8//TRANSLIT in the same way as from UTF-8 to UTF-8. + +2008-03-30 Bruno Haible + Avoid failure when attempting to return empty iconv results on some platforms. * lib/striconveh.c (mem_cd_iconveh_internal): In the final memory diff --git a/lib/striconveh.c b/lib/striconveh.c index 761f3b115..685117f81 100644 --- a/lib/striconveh.c +++ b/lib/striconveh.c @@ -1017,7 +1017,11 @@ mem_iconveh (const char *src, size_t srclen, } } - if (STRCASEEQ (to_codeset, "UTF-8", 'U','T','F','-','8',0,0,0,0)) + if (STRCASEEQ (to_codeset, "UTF-8", 'U','T','F','-','8',0,0,0,0) +# if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2) || __GLIBC__ > 2 || _LIBICONV_VERSION >= 0x0105 + || c_strcasecmp (to_codeset, "UTF-8//TRANSLIT") == 0 +# endif + ) cd2 = (iconv_t)(-1); else { @@ -1153,7 +1157,11 @@ str_iconveh (const char *src, } } - if (STRCASEEQ (to_codeset, "UTF-8", 'U','T','F','-','8',0,0,0,0)) + if (STRCASEEQ (to_codeset, "UTF-8", 'U','T','F','-','8',0,0,0,0) +# if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2) || __GLIBC__ > 2 || _LIBICONV_VERSION >= 0x0105 + || c_strcasecmp (to_codeset, "UTF-8//TRANSLIT") == 0 +# endif + ) cd2 = (iconv_t)(-1); else {