Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
[BUG] Unicode variables can be exported and are exported metafied
- X-seq: zsh-workers 34004
- From: ZyX <kp-pav@xxxxxxxxx>
- To: zsh-workers <zsh-workers@xxxxxxx>
- Subject: [BUG] Unicode variables can be exported and are exported metafied
- Date: Thu, 18 Dec 2014 21:19:25 +0300
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1418926766; bh=yfOkfB0/37zdpU7KRk1Wu7F+BxRiIBuHxzFx0dzNrXY=; h=From:To:Subject:Date; b=NATADHh840J3r6xMV1f5wDEBCnYicfRq0sdBtSZHdfIlBQyHc/+d3NgIo6Fhy6HAb 4BCviffvdbHI/kghzVPB0j+SlI06g4EjndfnR90DxhPCRXSkkW0TmcgMDyvlpPQJSF 6Ss2wA0tTCeH9CJFY6GhdO+wExKrIg/tfdvSbbbk=
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
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