[Tcsh] "Readable" Unicode in setenv

H.Merijn Brand tcsh at tux.freedom.nl
Mon Nov 15 22:43:07 UTC 2021


On Mon, 15 Nov 2021 11:33:55 -0500, Christos Zoulas <christos at zoulas.com> wrote:

> > On Nov 15, 2021, at 9:34 AM, H.Merijn Brand <tcsh at tux.freedom.nl> wrote:
> > On Mon, 15 Nov 2021 08:15:57 -0500, Christos Zoulas <christos at zoulas.com> wrote:
> >
> >> 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  
> 
> That is perhaps workable, but how about:
> 
> set x=\\u20AC

I expect \u20AC (not interpreted), but yes, this is becoming a gray
area where expectations might/will differ and DWIM is not the same
for all.

> I mean, quotes are optional for strings in shell, and that makes life complicated :-)
> 
> 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/2a66e803/attachment.asc>


More information about the Tcsh mailing list