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

Re: UNICODE Private Use Area characters in BUFFER



On Sun, Oct 23, 2022 at 7:02 PM Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
>
> On Sun, Oct 23, 2022, 9:45 AM Roman Perepelitsa <roman.perepelitsa@xxxxxxxxx> wrote:
>>
>> A few more tests to show that Private Use Area characters work find in
>> zsh with the exception that you cannot put then in BUFFER:
>
>
> I don't have the code handy, but I suspect this is due to the implementation of wisprnt() [sic] returning false for those characters.

You are right, iswprint(0xE0B0) returns 0.

I'm compiling zsh with --enable-unicode9, so instead of iswprint() it
goes into u9_iswprint(). This function explicitly handles this case
and returns 0, just like iswprint(). So we get this:

    WCWIDTH(0xE0B0) => 1
    WC_ISPRINT(0xE0B0) => 0

I think u9_iswprint() should return 1 for Private Use Area characters.

Roman.

P.S.

Why isn't --enable-unicode9 a default?




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