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

Re: [bug] busyloop upon $=var with NULs when $IFS contains both NUL and a byte > 0x7f



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




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