Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
[bug] bogus zparseopts error output when attempting to pass multibyte character options
- X-seq: zsh-workers 54077
- From: Stephane Chazelas <stephane@xxxxxxxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: [bug] bogus zparseopts error output when attempting to pass multibyte character options
- Date: Thu, 13 Nov 2025 20:52:06 +0000
- Archived-at: <https://zsh.org/workers/54077>
- List-id: <zsh-workers.zsh.org>
- Mail-followup-to: Zsh hackers list <zsh-workers@xxxxxxx>
$ 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