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

[bug] bogus zparseopts error output when attempting to pass multibyte character options



$ zsh -c 'zparseopts -F -D -A a a' zsh -é |& sed -n l
zsh:zparseopts:1: bad option: -^\003$

$ zsh -c 'zparseopts -F -D -A a a' zsh -€ |& sed -n l
zsh:zparseopts:1: bad option: -^"$

See those weird ^^C or ^", which are not even a representation
of the first byte of the encoding of those é and € characters.

More generally, trying to use multibyte characters in zparseopts
or getopts doesn't work.

$ zsh -c 'zparseopts -F -D -A a á é' zsh -áé |& sed -n l
zsh:zparseopts:1: bad option: -^\003$

$ zsh -c 'getopts á o; print -r - $o' zsh -á |& sed -n l
\303$

But then again, in the case of getopts, zsh is far from being
the only one. Only yash seems to work correctly with multibyte
characters AFAICT.

No big deal as it wouldn't be a good idea to use non-ASCII
characters in option names anyway.

-- 
Stephane




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