bash and the current locale implementation

Andy Koppe andy.koppe@gmail.com
Thu Oct 1 11:22:00 GMT 2009


2009/10/1 Corinna Vinschen:
>> > Consequentially, bash can't just call setlocale (LC_ALL, "").  Instead,
>> > bash calls the following:
>> >
>> >   setlocale (LC_CTYPE, "foo");
>> >   setlocale (LC_NUMERIC, "foo");
>> >   setlocale (LC_TIME, "foo");
>> >   [...]
>>
>> I'll see if I can find some way to patch bash.
>
>  setenv (locale_var);
>  if (locale_var == "LANG" || "LC_ALL")
>    setlocale (LC_ALL, "");
>  else if (locale_var == "LC_CTYPE")
>    setlocale (LC_CTYPE, "");
>
> would be sufficient.  But I can't say I'm really happy about this.  It
> sure sounds like a hack, having to change bash.  Unfortunately I can't
> see any way to change Cygwin as long as the application doesn't change
> its own environment.

I'm confused. I thought setlocale() wasn't meant to change Cygwin
internals aymore, because that would require all apps to call
setlocale(LC_CTYPE, "")? You'd cited ssh as an example that doesn't do
that.

Andy



More information about the Cygwin-developers mailing list