From: Bruno Haible Date: Wed, 14 Feb 2024 23:00:56 +0000 (+0100) Subject: Don't treat Apple's new Citrus/FreeBSD-based iconv like GNU libiconv. X-Git-Tag: v0.23~276 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=89714493722f689671a044c472bd0bee895c3a01;p=thirdparty%2Fgettext.git Don't treat Apple's new Citrus/FreeBSD-based iconv like GNU libiconv. * 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. --- diff --git a/gettext-tools/src/po-charset.c b/gettext-tools/src/po-charset.c index c4faeffd2..0e1d92018 100644 --- a/gettext-tools/src/po-charset.c +++ b/gettext-tools/src/po-charset.c @@ -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 , 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"); diff --git a/libtextstyle/gnulib-local/lib/iconv-ostream.oo.c b/libtextstyle/gnulib-local/lib/iconv-ostream.oo.c index 70e1f7d26..d815f95dc 100644 --- a/libtextstyle/gnulib-local/lib/iconv-ostream.oo.c +++ b/libtextstyle/gnulib-local/lib/iconv-ostream.oo.c @@ -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 , 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;