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 76a695ff203157e9a2810ef4b124aea74647710a..5df9267411b3403ba3d9b4586053a7a5f2350086 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+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
index 761f3b115b906b18b80d1ef1f9f22bd7f049cd60..685117f81608fc93e7a2a6c17f19b21faffcbdfe 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
        {