Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
multi-byte text decoding error can break word splitting by read at least
- X-seq: zsh-workers 53523
- From: Stephane Chazelas <stephane@xxxxxxxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: multi-byte text decoding error can break word splitting by read at least
- Date: Sun, 27 Apr 2025 16:40:43 +0100
- Archived-at: <https://zsh.org/workers/53523>
- List-id: <zsh-workers.zsh.org>
- Mail-followup-to: Zsh hackers list <zsh-workers@xxxxxxx>
There was some recent bug report on the bash mailing list about
"read" missing the delimiter when it followes a truncated
character, but zsh has similar issues when it comes to do doing
IFS splitting on the record once it has been read:
$ print 'a\302×b' | IFS=× read -rA a; typeset a
a=( $'a\M-B×b' )
Wasn't split on ×.
One might argue that doing reliable word splitting on non-text
is illusory anyway, but note that the latest version of the
POSIX standard now requires that splitting be done by looking
for the byte encodings of the characters in $IFS which would
make the behaviour above non-conformant.
See https://www.austingroupbugs.net/view.php?id=1920 for some
discussion on that though.
--
Stephane
Messages sorted by:
Reverse Date,
Date,
Thread,
Author