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

Re: read -d $'\200' doesn't work with set +o multibyte (and [PATCH])



> 2022/12/15 6:42, Oliver Kiddle <opk@xxxxxxx> wrote:
> 
> At least in my testing, it appears to also work to define delim as
> unsigned char which I would find less confusing.

I used int since delim is always compared with 'c' (=int).
But of course it's OK to use unsigned char.

>> +0:read with a delimeter >= 0x80

> 
> There's a typo in "delimiter"

Thanks.
# I was thinking 'delimeter' was the _correct_ spelling ;)

> The patch below needs to be applied on top of your patch.

Could you push all the patch?

But:
> It adds a few
> more test cases,
(snip)
> additional problem I was hitting when trying to reproduce the original
> problem. ...

Sorry, I missed your first post, and I din't considered the real
problem with multibyte locale.

> --- a/Test/B04read.ztst
> +++ b/Test/B04read.ztst
(snip)
> +  read -ed $'\xc2'
> +0:read delimited by a single byte terminates if the byte is part of a multibyte character
> +<one£two
> +>one

Is this really what the standard requires (or will require)?
Breaking in the middle of a valid multibyte character looks
rather odd to me.



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