Reported by Kiyoshi Kanazawa <yoi_no_myoujou@yahoo.co.jp>
via Akim Demaille <akim.demaille@gmail.com> in
<https://lists.gnu.org/archive/html/bug-gnulib/2020-07/msg00036.html>.
* lib/unicodeio.c (unicode_to_mb): Handle question mark fallback
characters on Solaris.
* tests/test-unicodeio.c (main): In the "C" locale, expect either the
UTF-8 output or the specified fallback.
+2020-07-09 Bruno Haible <bruno@clisp.org>
+
+ unicodeio: Fix wrong result on Solaris 11.
+ Reported by Kiyoshi Kanazawa <yoi_no_myoujou@yahoo.co.jp>
+ via Akim Demaille <akim.demaille@gmail.com> in
+ <https://lists.gnu.org/archive/html/bug-gnulib/2020-07/msg00036.html>.
+ * lib/unicodeio.c (unicode_to_mb): Handle question mark fallback
+ characters on Solaris.
+ * tests/test-unicodeio.c (main): In the "C" locale, expect either the
+ UTF-8 output or the specified fallback.
+
2020-07-08 Bruno Haible <bruno@clisp.org>
unicodeio: Add tests.
/* Irix iconv() inserts a NUL byte if it cannot convert. */
# 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 == '?')
# endif
)
return failure (code, NULL, callback_arg);
if (argc > 1)
switch (argv[1][0])
{
+ case '1': /* On some platforms, the "C" locale has UTF-8 encoding. */
case '2':
ASSERT (strcmp (result, TEST_CODE_AS_UTF8) == 0);
break;