]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Don't treat Apple's new Citrus/FreeBSD-based iconv like GNU libiconv.
authorBruno Haible <bruno@clisp.org>
Wed, 14 Feb 2024 23:00:56 +0000 (00:00 +0100)
committerBruno Haible <bruno@clisp.org>
Wed, 14 Feb 2024 23:00:56 +0000 (00:00 +0100)
* libtextstyle/gnulib-local/lib/iconv-ostream.oo.c (iconv_ostream::write_mem):
Don't treat the bastard Apple iconv like GNU libiconv.
* gettext-tools/src/po-charset.c (po_lex_charset_set): Likewise.

gettext-tools/src/po-charset.c
libtextstyle/gnulib-local/lib/iconv-ostream.oo.c

index c4faeffd2b8bfdf845ea0e784157a1cf29112155..0e1d92018dc0ad827761cfa7e262ec6470846f29 100644 (file)
@@ -1,5 +1,5 @@
 /* Charset handling while reading PO files.
-   Copyright (C) 2001-2007, 2010, 2019-2021, 2023 Free Software Foundation, Inc.
+   Copyright (C) 2001-2024 Free Software Foundation, Inc.
    Written by Bruno Haible <haible@clisp.cons.org>, 2001.
 
    This program is free software: you can redistribute it and/or modify
@@ -597,7 +597,7 @@ Charset \"%s\" is not supported. %s relies on iconv(),\n\
 and iconv() does not support \"%s\".\n"),
                                po_lex_charset, progname, po_lex_charset);
 
-# if !defined _LIBICONV_VERSION
+# if !defined _LIBICONV_VERSION || (_LIBICONV_VERSION == 0x10b && defined __APPLE__)
                   recommendation = _("\
 Installing GNU libiconv and then reinstalling GNU gettext\n\
 would fix this problem.\n");
index 70e1f7d26c4ece7acbda8b7cdd6b2d4e5ce61ccc..d815f95dcb7f60d503206c56c813dd16e981a414 100644 (file)
@@ -1,5 +1,5 @@
 /* Output stream that converts the output to another encoding.
-   Copyright (C) 2006-2007, 2010, 2019-2020 Free Software Foundation, Inc.
+   Copyright (C) 2006-2024 Free Software Foundation, Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2006.
 
    This program is free software: you can redistribute it and/or modify
@@ -98,12 +98,13 @@ iconv_ostream::write_mem (iconv_ostream_t stream, const void *data, size_t len)
             size_t res = iconv (stream->cd,
                                 (ICONV_CONST char **) &inptr, &insize,
                                 &outptr, &outsize);
-            #if !defined _LIBICONV_VERSION \
+            #if !(defined _LIBICONV_VERSION && !(_LIBICONV_VERSION == 0x10b && defined __APPLE__)) \
                 && !(defined __GLIBC__ && !defined __UCLIBC__)
             /* Irix iconv() inserts a NUL byte if it cannot convert.
                NetBSD iconv() inserts a question mark if it cannot convert.
-               Only GNU libiconv and GNU libc are known to prefer to fail rather
-               than doing a lossy conversion.  */
+               Only GNU libiconv (excluding the bastard Apple iconv) and
+               GNU libc are known to prefer to fail rather than doing a lossy
+               conversion.  */
             if (res > 0)
               {
                 errno = EILSEQ;