From: Bruno Haible Date: Mon, 7 Dec 2020 20:13:54 +0000 (+0100) Subject: unicodeio: Fix wrong result on FreeBSD. X-Git-Tag: v1.0~3402 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e649a3bbd4be8a6af0db7275f6600bb5bed1ffb7;p=thirdparty%2Fgnulib.git unicodeio: Fix wrong result on FreeBSD. * lib/unicodeio.c (unicode_to_mb): Handle question mark fallback characters on all platforms. --- diff --git a/ChangeLog b/ChangeLog index da760380c1..5992c891d9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2020-12-07 Bruno Haible + + unicodeio: Fix wrong result on FreeBSD. + * lib/unicodeio.c (unicode_to_mb): Handle question mark fallback + characters on all platforms. + 2020-12-07 Bruno Haible get-rusage-data tests: Avoid test failure on FreeBSD/x86_64. diff --git a/lib/unicodeio.c b/lib/unicodeio.c index d587a278d6..3d7a6029bc 100644 --- a/lib/unicodeio.c +++ b/lib/unicodeio.c @@ -142,9 +142,9 @@ unicode_to_mb (unsigned int code, # if !defined _LIBICONV_VERSION && (defined sgi || defined __sgi) || (res > 0 && code != 0 && outptr - outbuf == 1 && *outbuf == '\0') # endif - /* NetBSD iconv() and Solaris 11 iconv() insert a '?' if they cannot - convert. */ -# if !defined _LIBICONV_VERSION && (defined __NetBSD__ || defined __sun) + /* FreeBSD iconv(), NetBSD iconv(), and Solaris 11 iconv() insert + a '?' if they cannot convert. */ +# if !defined _LIBICONV_VERSION || (res > 0 && outptr - outbuf == 1 && *outbuf == '?') # endif /* musl libc iconv() inserts a '*' if it cannot convert. */