From e888c3d554a74818d5546032f047593018923fc8 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Fri, 10 Jul 2020 09:51:52 +0200 Subject: [PATCH] unicodeio: Fix wrong result on NetBSD. * lib/unicodeio.c (unicode_to_mb): Handle question mark fallback characters also on NetBSD. --- ChangeLog | 6 ++++++ lib/unicodeio.c | 7 ++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 556fb53525..3737892191 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2020-07-10 Bruno Haible + + unicodeio: Fix wrong result on NetBSD. + * lib/unicodeio.c (unicode_to_mb): Handle question mark fallback + characters also on NetBSD. + 2020-07-09 Bruno Haible unicodeio: Fix wrong result on Solaris 11. diff --git a/lib/unicodeio.c b/lib/unicodeio.c index 81fe0ddbf9..b616e3d61f 100644 --- a/lib/unicodeio.c +++ b/lib/unicodeio.c @@ -134,9 +134,10 @@ unicode_to_mb (unsigned int code, # if !defined _LIBICONV_VERSION && (defined sgi || defined __sgi) || (res > 0 && code != 0 && outptr - outbuf == 1 && *outbuf == '\0') # endif - /* Solaris 11 iconv() inserts a '?' if it cannot convert. */ -# if !defined _LIBICONV_VERSION && defined __sun - || (res > 0 && code != 0 && outptr - outbuf == 1 && *outbuf == '?') + /* NetBSD iconv() and Solaris 11 iconv() insert a '?' if they cannot + convert. */ +# if !defined _LIBICONV_VERSION && (defined __NetBSD__ || defined __sun) + || (res > 0 && outptr - outbuf == 1 && *outbuf == '?') # endif ) return failure (code, NULL, callback_arg); -- 2.39.5