[Tcsh] "Readable" Unicode in setenv
H.Merijn Brand
tcsh at tux.freedom.nl
Mon Nov 15 14:34:49 UTC 2021
On Mon, 15 Nov 2021 08:15:57 -0500, Christos Zoulas <christos at zoulas.com> wrote:
> > On Nov 14, 2021, at 8:29 AM, H.Merijn Brand <tcsh at tux.freedom.nl> wrote:
> >
> > Signed PGP part
> > On Sat, 13 Nov 2021 19:16:07 -0500, Christos Zoulas <christos at zoulas.com <mailto:christos at zoulas.com>> wrote:
> >
> >> Committed, thanks!
> >
> > Wow, thanks. Would it be hard(er) to also allow
> >
> > % setenv EURO "\u20AC"
> >
> > directly too instead of
> >
> > % setenv EURO `echo "\u20AC"`
> >
> > (you can also hint me to the location in/of the code and I'll play around myself)
> >
>
> I am not sure... How do you enter a literal "\u20AC" then in the environment?
> setenv EURO "\\u20AC"?
Use single quotes, but yeah, that might confuse Windows users
To me
% setenv EURO "\u20AC"
% env | grep EURO => €
% setenv EURO '\u20AC'
% env | grep EURO => \u20AC
would be intuitive, but I have a strong perl-background, so that might explain.
> Does not seem very intuitive to me. At least we have simple "output" semantics
> here for echo. What would be the "input" semantics, and which commands do they
> affect? I.e. does the translation happen for all variables on assignment? For all
> literal strings present in csh code?
Yes, for all double-quoted literal strings in csh code (maybe that could be an option)
No, for all single-quoted literal strings in csh code
braindump:
% set literal_escapes=U
"\u20AC" => €
"\x{20AC}" => \x{20AC}
"\101" => \101
% set literal_escapes=X
"\u20AC" => \u20AC
"\x{20AC}" => €
"\101" => \101
% set literal_escapes=UXO
"\u20AC" => €
"\x{20AC}" => €
"\101" => A
> christos
--
H.Merijn Brand https://tux.nl Perl Monger http://amsterdam.pm.org/
using perl5.00307 .. 5.33 porting perl5 on HP-UX, AIX, and Linux
https://tux.nl/email.html http://qa.perl.org https://www.test-smoke.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <https://mailman.astron.com/pipermail/tcsh/attachments/20211115/1c947d0e/attachment.asc>
More information about the Tcsh
mailing list