]> Savannah Git Hosting - gnulib.git/commitdiff
Improve support of Citrus/FreeBSD iconv.
authorBruno Haible <bruno@clisp.org>
Wed, 14 Feb 2024 22:16:15 +0000 (23:16 +0100)
committerBruno Haible <bruno@clisp.org>
Sat, 16 Mar 2024 08:00:22 +0000 (09:00 +0100)
* lib/striconveh.c (iconveh_open): Use //TRANSLIT with all iconv
implementations that support it.
* lib/striconveha.c (mem_iconveha, str_iconveha): Likewise.
* lib/propername.c (proper_name_utf8): Likewise.

ChangeLog
lib/propername.c
lib/striconveh.c
lib/striconveha.c

index c35253d903005eb1d459573d0eec7c2f9380bfff..7b5b1a98b48ea8e7e8bd328e7779ea468395f782 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2024-02-14  Bruno Haible  <bruno@clisp.org>
+
+       Improve support of Citrus/FreeBSD iconv.
+       * lib/striconveh.c (iconveh_open): Use //TRANSLIT with all iconv
+       implementations that support it.
+       * lib/striconveha.c (mem_iconveha, str_iconveha): Likewise.
+       * lib/propername.c (proper_name_utf8): Likewise.
+
 2024-02-14  Bruno Haible  <bruno@clisp.org>
 
        isnan: Fix compilation error in C++ mode on macOS 14.4 / Xcode 15.2.
index a4d4f72cdfcd20b1eea8929a7c49818c81c69936..d5b52a2c1105a82e213cc2552fc9b20eabb1c62b 100644 (file)
@@ -228,7 +228,8 @@ proper_name_utf8 (const char *name_ascii, const char *name_utf8)
 
 # if (((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2) || __GLIBC__ > 2) \
       && !defined __UCLIBC__) \
-     || _LIBICONV_VERSION >= 0x0105
+     || _LIBICONV_VERSION >= 0x0105 \
+     || defined ICONV_SET_TRANSLITERATE
       {
         char *converted_translit;
 
index bf4a2e7b54126d73a3ff349ccf0c58307744ad20..43cc3e11a42dae755df5fc200640ed4d216086b5 100644 (file)
@@ -81,7 +81,8 @@ iconveh_open (const char *to_codeset, const char *from_codeset, iconveh_t *cdp)
   if (STRCASEEQ (to_codeset, "UTF-8", 'U','T','F','-','8',0,0,0,0)
 # if (((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2) || __GLIBC__ > 2) \
       && !defined __UCLIBC__) \
-     || _LIBICONV_VERSION >= 0x0105
+     || _LIBICONV_VERSION >= 0x0105 \
+     || defined ICONV_SET_TRANSLITERATE
       || c_strcasecmp (to_codeset, "UTF-8//TRANSLIT") == 0
 # endif
      )
index 19b6700a0ec712af9bd6d9a92153afc1881964eb..08008d8bdc94829e7e09ff81a802f1ff4555f233 100644 (file)
@@ -219,11 +219,12 @@ mem_iconveha (const char *src, size_t srclen,
       return 0;
     }
 
-  /* When using GNU libc >= 2.2 or GNU libiconv >= 1.5,
-     we want to use transliteration.  */
+  /* When using GNU libc >= 2.2 or GNU libiconv >= 1.5 or Citrus/FreeBSD/macOS
+     iconv, we want to use transliteration.  */
 #if (((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2) || __GLIBC__ > 2) \
      && !defined __UCLIBC__) \
-    || _LIBICONV_VERSION >= 0x0105
+    || _LIBICONV_VERSION >= 0x0105 \
+    || defined ICONV_SET_TRANSLITERATE
   if (transliterate)
     {
       int retval;
@@ -326,11 +327,12 @@ str_iconveha (const char *src,
       return result;
     }
 
-  /* When using GNU libc >= 2.2 or GNU libiconv >= 1.5,
-     we want to use transliteration.  */
+  /* When using GNU libc >= 2.2 or GNU libiconv >= 1.5 or Citrus/FreeBSD/macOS
+     iconv, we want to use transliteration.  */
 #if (((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2) || __GLIBC__ > 2) \
      && !defined __UCLIBC__) \
-    || _LIBICONV_VERSION >= 0x0105
+    || _LIBICONV_VERSION >= 0x0105 \
+    || defined ICONV_SET_TRANSLITERATE
   if (transliterate)
     {
       char *result;