Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: E02 failing on Alpine / musl libc



> 2022/05/16 16:14, dana <dana@xxxxxxx> wrote:
> 
> I assume it's to do with this:
> 
>> Starting with version 1.1.11, musl provides a special C locale where bytes
>> 0x80-0xff are treated as abstract single-byte-character units with no actual
>> character identity (they’re mapped into wchar_t values that occupy the
>> Unicode surrogates range).

I tried Alpine for the first time, and found that E02 and two other tests
(see below) failed due to this "special" C locale.

In this "special" C locale,
   str[0] = 0xXX;  /* any value in the range 0x80-0xff */
   mbrtowc(&wc, str, 1, &mbs);
sets wc to 0xdfXX (not just 0xXX).
For example, if 0xXX is 0x83 then wc is set to 0xdf83.

This is indeed "special", but it seems globbing etc. works without problem.
So I think we need/should not "fix" this, because 0xfdXX (or \ufdXX) is the
correct representation in their "special" C loale.

IF they want they can just change (in their package) the expected outputs
of the tests to their correct values.


These are the two tests that fail due to the same reason:

./A03quoting.ztst: starting.
--- /tmp/zsh.ztst.13004/ztst.out
+++ /tmp/zsh.ztst.13004/ztst.tout
@@ -4,4 +4,4 @@
 16#4D
 16#42
 16#53
-16#DC
+16#DFDC
Test ./A03quoting.ztst failed: output differs from expected as shown above for:
  chars=$(print -r $'BS\\MBS\M-\\')
  for (( i = 1; i <= $#chars; i++ )); do
    char=$chars[$i]
    print $(( [#16] #char ))
  done
Was testing: $'-style quote with metafied backslash


./B03print.ztst: starting.
--- /tmp/zsh.ztst.20798/ztst.out
+++ /tmp/zsh.ztst.20798/ztst.tout
@@ -1 +1 @@
-f0
+dff0
Test ./B03print.ztst failed: output differs from expected as shown above for:
 printf '%x\n' $(printf '"\xf0')
Was testing: numeric value of high numbered character






Messages sorted by: Reverse Date, Date, Thread, Author