From: ZyX <kp-pav@yandex.ru>
To: Ray Andrews <rayandrews@eastlink.ca>,
"zsh-users@zsh.org" <zsh-users@zsh.org>
Subject: Re: utf-8
Date: Thu, 18 Dec 2014 21:52:01 +0300 [thread overview]
Message-ID: <1182711418928721@web19g.yandex.ru> (raw)
In-Reply-To: <54931FE4.2050100@eastlink.ca>
18.12.2014, 21:41, "Ray Andrews" <rayandrews@eastlink.ca>:
> On 12/18/2014 10:05 AM, ZyX wrote:
>> It is permitted at least in variable and function names: though I cannot find anything relevant in
> ...
>
> Seems I can use unicode 'one way' but not the other:
You are missing the main point. Identifiers consist of the characters for which `iswalnum` is true (there is an implementation detail that for ASCII characters internal zsh equivalent is used, so that glibc has no chances to say that U+0041 LATIN CAPITAL LETTER A is not an alphanumeric character (manual page actually says it must not do this though in any locale) or that U+003D EQUALS SIGN is). “☠” is U+2620 SKULL AND CROSSBONES which does *not* have unicode category “Letter” or “Number” and thus cannot be used in an identifier. To use it in an identifier you must create a custom libc locale (or even a custom libc) which will return true for `iswalnum(0x2620)`.
This is usual behaviour for many languages that have unicode identifiers: use unicode character classes for deciding which codepoints may and which may not form an identifier.
>
>> $ howdy=☠
>>
>> $ echo $howdy
>> ☠
>>
>> $ ☠=howdy
>> zsh: command not found: ☠=howdy
>>
>> $ var☠=howdy
>> zsh: command not found: var☠=howdy
>
> multibyte is on, all 'posix*' options are off.
Try testing with something like `ПЕРЕМЕННАЯ` (Russian translation of “VARIABLE”) or `αβγ` (first three Greek letters). They do work, at least on my system.
next prev parent reply other threads:[~2014-12-18 18:57 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-17 18:05 utf-8 Ray Andrews
2014-12-17 20:31 ` utf-8 ZyX
2014-12-18 0:39 ` utf-8 Ray Andrews
2014-12-18 6:48 ` utf-8 Павлов Николай Александрович
2014-12-18 9:25 ` utf-8 Mikael Magnusson
2014-12-18 9:25 ` utf-8 Peter Stephenson
2014-12-18 17:36 ` utf-8 Ray Andrews
2014-12-18 17:48 ` utf-8 Peter Stephenson
2014-12-18 18:14 ` utf-8 Ray Andrews
2014-12-18 18:22 ` utf-8 ZyX
2014-12-18 18:05 ` utf-8 ZyX
2014-12-18 18:41 ` utf-8 Ray Andrews
2014-12-18 18:52 ` ZyX [this message]
2014-12-18 20:04 ` utf-8 Ray Andrews
2014-12-18 20:12 ` utf-8 Peter Stephenson
2014-12-18 20:52 ` utf-8 ZyX
2014-12-18 21:15 ` utf-8 Ray Andrews
2014-12-18 21:38 ` utf-8 ZyX
2014-12-18 23:55 ` utf-8 Ray Andrews
2014-12-19 2:04 ` utf-8 Bart Schaefer
2014-12-19 2:27 ` utf-8 Ray Andrews
2014-12-19 2:32 ` utf-8 Mikael Magnusson
2014-12-19 2:45 ` utf-8 Bart Schaefer
2014-12-19 6:34 ` utf-8 Ray Andrews
2014-12-19 7:02 ` utf-8 Bart Schaefer
2014-12-19 17:04 ` utf-8 Ray Andrews
2014-12-19 22:06 ` utf-8 ZyX
2014-12-19 7:29 ` utf-8 Павлов Николай Александрович
2014-12-19 3:50 ` utf-8 Lawrence Velázquez
2014-12-19 5:24 ` utf-8 Павлов Николай Александрович
2014-12-19 5:18 ` utf-8 Павлов Николай Александрович
[not found] <BC9BC140-F1A5-11D5-BA73-000393164560@mas.ecp.fr>
2001-12-18 16:51 ` UTF-8 Oliver Kiddle
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1182711418928721@web19g.yandex.ru \
--to=kp-pav@yandex.ru \
--cc=rayandrews@eastlink.ca \
--cc=zsh-users@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).