[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Patch for unicode in varnames...
From: |
dualbus |
Subject: |
Re: Patch for unicode in varnames... |
Date: |
Mon, 5 Jun 2017 09:04:13 -0500 |
User-agent: |
NeoMutt/20170113 (1.7.2) |
On Mon, Jun 05, 2017 at 04:52:19AM -0400, George wrote:
[...]
> To hazard a guess: Each call to legal_identifier() and assignment() in
> the patched code requires copying the parameter and translating it to
> a wide-character string (with no provision for skipping the added work
> as a build option). It appears the memory allocated for these copies
> leaks (I didn't see any added calls to xfree() to go with those new
> xmallocs()), and the character type for the character conversion is
> derived from the user's locale (which means there's not a reliable
> mechanism in place to run a script in a locale whose character
> encoding doesn't match that of the script.) And he did mention "issues
> with compound assignments" as well. Those issues would need to be
> resolved.
Correct. There's also mixed use of wide-character strings and normal
strings, because that was easier to hack quickly.
By the way, ksh93 and zsh already support Unicode identifiers:
dualbus@debian:~$ for sh in bash mksh ksh93 zsh; do LC_CTYPE=en_US.utf8 $sh
-c 'φ=phi; echo $φ'; done
bash: φ=phi: command not found
$φ
mksh: φ=phi: not found
$φ
phi
phi
And all of these four support Unicode function names:
dualbus@debian:~$ for sh in bash mksh ksh93 zsh; do LC_CTYPE=en_US.utf8
$sh -c 'φ() { echo hi; }; φ'; done
hi
hi
hi
hi
--
Eduardo Bustamante
https://dualbus.me/
- Re: Patch for unicode in varnames..., (continued)
- Re: Patch for unicode in varnames..., George, 2017/06/07
- Re: Patch for unicode in varnames..., Dethrophes, 2017/06/07
- Re: Patch for unicode in varnames..., Peter & Kelly Passchier, 2017/06/07
- Re: Patch for unicode in varnames..., L A Walsh, 2017/06/09
- Re: Patch for unicode in varnames..., Chet Ramey, 2017/06/13
- Re: Patch for unicode in varnames..., Peter & Kelly Passchier, 2017/06/05
- Re: Patch for unicode in varnames..., Chet Ramey, 2017/06/13
- Re: Patch for unicode in varnames..., Chet Ramey, 2017/06/13
- Re: Patch for unicode in varnames...,
dualbus <=
- Re: Patch for unicode in varnames..., Chet Ramey, 2017/06/13
- Re: Patch for unicode in varnames..., Chet Ramey, 2017/06/13
- Re: Patch for unicode in varnames..., Eduardo Bustamante, 2017/06/15
- Re: RFE: Please allow unicode ID chars in identifiers, Chet Ramey, 2017/06/13
- Re: RFE: Please allow unicode ID chars in identifiers, Chet Ramey, 2017/06/13
- Re: RFE: Please allow unicode ID chars in identifiers, tetsujin, 2017/06/13
- Re: RFE: Please allow unicode ID chars in identifiers, Chet Ramey, 2017/06/13
- Re: RFE: Please allow unicode ID chars in identifiers, Chet Ramey, 2017/06/13
- Re: RFE: Please allow unicode ID chars in identifiers, tetsujin, 2017/06/02
- Re: RFE: Please allow unicode ID chars in identifiers, Chet Ramey, 2017/06/13