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

Re: (LC_ALL=C; set -x 128 129; printf "%s\n" ${(#)@} | hexdump -C)



> 2023/09/11 21:11, Jun. T <takimoto-j@xxxxxxxxxxxxxxxxx> wrote:
> 
> This is some test for (#) and (#X).

Sorry, I've already pushed this, but the test fails on FreeBSD,
DragonFly and NetBSD for out-of-range characters.

On these OSes (with or without my patch):

% LC_ALL=C zsh -f
% echo ${(#):-0x80} | hexdump -C
00000000  3f 0a                                             |?.|
00000002

This is due to the peculiar behavior of iconv(3). It converts
out-of-range character to '?' (0x3f) with return value 1,
indicating that one character is converted in "non-reversible" way.

I feel this is a "bug" of iconv(), but maybe better to implement
some workaround. I'm getting rather busy now, but hopefully I can
work on this within a few days.




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