zsh-workers
 help / color / mirror / code / Atom feed
From: Jun T <takimoto-j@kba.biglobe.ne.jp>
To: zsh-workers@zsh.org
Subject: Re: E02 failing on Alpine / musl libc
Date: Tue, 17 May 2022 11:33:40 +0900	[thread overview]
Message-ID: <89079237-6D93-45F0-B11B-7516372CB370@kba.biglobe.ne.jp> (raw)
In-Reply-To: <2d2b70ef-60b7-4f4b-b85a-8f651a8179ba@www.fastmail.com>


> 2022/05/16 16:14, dana <dana@dana.is> 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




  parent reply	other threads:[~2022-05-17  2:34 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-16  7:14 dana
2022-05-16 10:54 ` Peter Stephenson
2022-05-17  2:33 ` Jun T [this message]
2022-05-19  3:27   ` dana

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=89079237-6D93-45F0-B11B-7516372CB370@kba.biglobe.ne.jp \
    --to=takimoto-j@kba.biglobe.ne.jp \
    --cc=zsh-workers@zsh.org \
    --subject='Re: E02 failing on Alpine / musl libc' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Code repositories for project(s) associated with this inbox:

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).