[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Patch for unicode in varnames...

From: Chet Ramey
Subject: Re: Patch for unicode in varnames...
Date: Tue, 13 Jun 2017 15:40:26 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.1.1

On 6/5/17 6:39 PM, George wrote:

> If Bash did go the route of using the locale to set the character encoding of 
> a script, I think it would be best to have a mechanism a script can use
> to define the character encoding for the whole script file up front, rather 
> than setting LC_CTYPE to procedurally change the behavior of the shell.

A script can use an assignment to LC_CTYPE (or LC_ALL, or LANG) at the
beginning of a script to "define the character encoding for the whole
script file up front."

Doing this with "source" is a little more problematic, because
fundamentally shell variable names are simply strings of bytes. If you
change the locale between defining a shell variable and referencing it,
possibly multiple times, you're going to have a character set problem.
There are tools like iconv that can help you with that, but that's a
clumsy solution.

``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    address@hidden    http://cnswww.cns.cwru.edu/~chet/

reply via email to

[Prev in Thread] Current Thread [Next in Thread]