[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: portability issues with unicodeio
From: |
Bruno Haible |
Subject: |
Re: portability issues with unicodeio |
Date: |
Thu, 09 Jul 2020 17:31:21 +0200 |
User-agent: |
KMail/5.1.3 (Linux/4.4.0-179-generic; KDE/5.18.0; x86_64; ; ) |
Kiyoshi KANAZAWA wrote:
> make check passed both on Solaris 11.3 & 11.4.
Oh, I see. So my unit test was not complete.
> > It is succeeds this test, then what is the difference between the
> > coreutils printf program and the test-unicodeio.c program? Both call
> > setlocale (LC_ALL, "").
>
> I do not understand.
> What should I do next ?
I single-stepped both the coreutils printf program and the test-unicodeio.c
program, and found the issue.
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.
diff --git a/lib/unicodeio.c b/lib/unicodeio.c
index 8ae3308..81fe0dd 100644
--- a/lib/unicodeio.c
+++ b/lib/unicodeio.c
@@ -134,6 +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 == '?')
+# endif
)
return failure (code, NULL, callback_arg);
diff --git a/tests/test-unicodeio.c b/tests/test-unicodeio.c
index be91a91..fa28e98 100644
--- a/tests/test-unicodeio.c
+++ b/tests/test-unicodeio.c
@@ -62,6 +62,7 @@ main (int argc, char *argv[])
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;
- Re: [GNU Bison 3.6.90] testsuite: 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 196 220 221 228 244 245 246 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 549 555 562 567 577 failed, (continued)
- Re: [GNU Bison 3.6.90] testsuite: 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 196 220 221 228 244 245 246 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 549 555 562 567 577 failed, Akim Demaille, 2020/07/06
- Re: [GNU Bison 3.6.90] testsuite: 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 196 220 221 228 244 245 246 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 549 555 562 567 577 failed, Kiyoshi KANAZAWA, 2020/07/06
- Re: [GNU Bison 3.6.90] testsuite: 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 196 220 221 228 244 245 246 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 549 555 562 567 577 failed, Akim Demaille, 2020/07/06
- Re: [GNU Bison 3.6.90] testsuite: 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 196 220 221 228 244 245 246 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 549 555 562 567 577 failed, Kiyoshi KANAZAWA, 2020/07/06
- portability issues with unicodeio (was: [GNU Bison 3.6.90] testsuite: 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 196 220 221 228 244 245 246 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 549 555 562 567 577 failed), Akim Demaille, 2020/07/08
- Re: portability issues with unicodeio, Bruno Haible, 2020/07/08
- Re: portability issues with unicodeio, Kiyoshi KANAZAWA, 2020/07/08
- Re: portability issues with unicodeio, Kiyoshi KANAZAWA, 2020/07/08
- Re: portability issues with unicodeio, Bruno Haible, 2020/07/08
- Re: portability issues with unicodeio, Kiyoshi KANAZAWA, 2020/07/08
- Re: portability issues with unicodeio,
Bruno Haible <=
- Re: portability issues with unicodeio, Akim Demaille, 2020/07/10
- Re: portability issues with unicodeio, Bruno Haible, 2020/07/10