changeset 9836:69507e40ea4f

Optimize conversion from UTF-8 to UTF-8//TRANSLIT.
author Bruno Haible <bruno@clisp.org>
date Sun, 30 Mar 2008 18:56:58 +0200
parents 69955b112e2e
children 8c80e0046993
files ChangeLog lib/striconveh.c
diffstat 2 files changed, 15 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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
--- a/lib/striconveh.c
+++ b/lib/striconveh.c
@@ -1017,7 +1017,11 @@
 	    }
 	}
 
-      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 @@
 	    }
 	}
 
-      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
 	{