Optimize conversion from UTF-8 to UTF-8//TRANSLIT.
authorBruno Haible <bruno@clisp.org>
Sun, 30 Mar 2008 16:56:58 +0000 (18:56 +0200)
committerBruno Haible <bruno@clisp.org>
Sun, 30 Mar 2008 16:56:58 +0000 (18:56 +0200)
ChangeLog
lib/striconveh.c

index 76a695f..5df9267 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2008-03-30  Bruno Haible  <bruno@clisp.org>
 
+       * 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  <bruno@clisp.org>
+
        Avoid failure when attempting to return empty iconv results on some
        platforms.
        * lib/striconveh.c (mem_cd_iconveh_internal): In the final memory
index 761f3b1..685117f 100644 (file)
@@ -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
        {