bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: mbrtowc tests: don't make assumptions about the charset the C locale


From: Bernhard Voelker
Subject: Re: mbrtowc tests: don't make assumptions about the charset the C locale
Date: Sat, 24 Feb 2018 23:39:15 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0

On 02/24/2018 12:02 PM, Bruno Haible wrote:
On Alpine Linux 3.7.0, which uses musl libc, this test fails:

FAIL: test-mbrtowc5.sh
======================

../../gltests/test-mbrtowc.c:106: assertion 'wc == c' failed
Aborted
FAIL test-mbrtowc5.sh (exit status: 134)

The issue is that in the C locale, musl uses the encoding that maps
   0x00..0x7F -> U+0000..U+007F
   0x80..0xFF -> U+DF80..U+DFFF

Whereas for older platforms it was natural to use the ISO-8859-1 encoding:
   0x00..0x7F -> U+0000..U+007F
   0x80..0xFF -> U+0080..U+00FF

This patch fixes the test.

Now this test fails on GNU/Linux - at least here on openSUSE-Tumbleweed.

FAIL: test-mbrtowc5.sh
======================

test-mbrtowc.c:114: assertion 'wc == btowc (c)' failed
./test-mbrtowc5.sh: line 4: 21847 Aborted                 (core dumped) 
LC_ALL=C ./test-mbrtowc${EXEEXT} 5
FAIL test-mbrtowc5.sh (exit status: 134)


(gdb) bt
#0  __GI_raise (address@hidden) at ../sysdeps/unix/sysv/linux/raise.c:51
#1  0x00007ffff7a546b1 in __GI_abort () at abort.c:79
#2  0x0000000000400a7d in main (argc=<optimized out>, argv=<optimized out>) at 
test-mbrtowc.c:58
gdb) p wc
$2 = 128 L'\200'

Do you see the same?

Have a nice day,
Berny



reply via email to

[Prev in Thread] Current Thread [Next in Thread]