From: Stephane Chazelas <stephane@chazelas.org>
To: "Jun. T" <takimoto-j@kba.biglobe.ne.jp>
Cc: zsh-workers@zsh.org
Subject: Re: [bug] busyloop upon $=var with NULs when $IFS contains both NUL and a byte > 0x7f
Date: Sun, 11 Dec 2022 19:12:57 +0000 [thread overview]
Message-ID: <20221211191257.xbzoprtr56qd5577@chazelas.org> (raw)
In-Reply-To: <AD3B3716-F348-4C93-981F-8B8DD624C37D@kba.biglobe.ne.jp>
2022-11-29 23:27:10 +0900, Jun. T:
[...]
> This not simple to solve. The basic question is:
> What should we do if IFS contains invalid characters?
[...]
As also mentioned in the read -d $'\200' thread, in some other
parts of the code, bytes that can't be decoded into characters
in the locale's charmap are decoded as a 0xdc00 + byte_value.
(see See workers/36411 workers/36415)
So here, in a UTF-8 locale, IFS=$'\200' could be decoded as a
0xdc80 wchar_t and split on 0xdc80 wchar_t's only in the input
(0x80 byte values not found to be part of a character).
--
Stephane
next prev parent reply other threads:[~2022-12-11 19:13 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-18 14:27 Stephane Chazelas
2022-11-29 14:27 ` Jun. T
2022-11-29 14:38 ` Peter Stephenson
2022-11-30 4:20 ` Bart Schaefer
2022-11-30 9:21 ` Peter Stephenson
2022-12-13 9:50 ` Jun T
2022-12-13 9:49 ` Jun T
2022-12-13 10:13 ` Peter Stephenson
2022-12-13 11:40 ` Jun T
2022-12-13 11:55 ` Peter Stephenson
2023-06-21 4:49 ` Jun T
2022-12-11 19:12 ` Stephane Chazelas [this message]
2022-12-13 9:51 ` Jun T
2022-11-30 14:56 ` Jun. T
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=20221211191257.xbzoprtr56qd5577@chazelas.org \
--to=stephane@chazelas.org \
--cc=takimoto-j@kba.biglobe.ne.jp \
--cc=zsh-workers@zsh.org \
/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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public 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).