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

[BUG] Unicode variables can be exported and are exported metafied



Consider the following input (zsh -f, UTF-8 locale):

zyx-desktop% ус=1
zyx-desktop% export ус
zyx-desktop% env | grep '=1' | grep '^[^A-Z]'
у�с=1
zyx-desktop% env | grep '=1' | grep '^[^A-Z]' | hexdump -C
00000000  d1 83 a3 d1 81 3d 31 0a                           |.....=1.|
00000008
zyx-desktop% echo ус=1 | hexdump -C
00000000  d1 83 d1 81 3d 31 0a                              |....=1.|
00000007

You see here that variable named `ус` can be exported (not sure whether it is a bug or not), but its 0x83 byte which is the last byte of the first unicode codepoint that forms the variable name represented as UTF-8 is using zsh `Meta` escape in the `env` output (which clearly is a bug assuming the fact that unicode variable is exported is not).



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