"C" UTF-8 trouble

Christopher Faylor cgf-use-the-mailinglist-please@cygwin.com
Tue Oct 6 18:17:00 GMT 2009


On Tue, Oct 06, 2009 at 05:37:24PM +0200, Corinna Vinschen wrote:
>On Oct  6 16:14, Andy Koppe wrote:
>> 2009/10/6 Corinna Vinschen:
>> > The problem is what do we do? ?POSIX requires that the default
>> > locale is "C".
>> 
>> Agreed, we can't change that.
>> 
>> 
>> >?Do you actually propose to change the environment at
>> > process startup
>> 
>> Yes, except that I was thinking it would be sufficient to do this at
>> the start of a Cygwin process tree only, and not for every process.
>> 
>> 
>> > along these lines:
>> >
>> > ?if (!getenv ("LC_ALL") && !getenv ("LC_CTYPE", && !getenv ("LANG"))
>> > ? ?setenv ("LC_CTYPE", "C.UTF-8", 0);
>> 
>> This would do:
>> 
>>   setenv ("LANG", "C.UTF-8", 0);
>> 
>> Zero as the third parameter ensures that an existing LANG isn't
>> overwritten. And if LC_ALL or LC_CTYPE are set, they override LANG
>> anyway.
>
>Os it really necessary to change Cygwibn for this?  I'm wondering if we
>should put this into /etc/profile and /etc/csh.login instead.  

In my limited understanding of the issue, that sounds like a better plan
to me.  It seems like the DLL should not be dictating this type of
policy if we can help it because, if we make a mistake, it will require
a new cygwin release.

cgf



More information about the Cygwin-developers mailing list