bash and the current locale implementation

Andy Koppe
Thu Oct 1 18:34:00 GMT 2009

2009/10/1 Corinna Vinschen
> Ok, I have a small patch which changes the current implementation
> so that a switch to another Cygwin-internal charset only works at
> process startup.  No setenv/setlocale combination from the application
> itself will change the internally used charset.
> Basically that's what you see in bash already without the change.
> export LANG=de will only have an effect on child processes.
> Is that now the feasible behaviour, finally?

Fingers crossed ...

>   /* Set internal locale to the environment settings. */
> -  setlocale (LC_CTYPE, "");
> +  initial_setlocale ();
>   /* Reset application locale to "C" per POSIX */
>   _setlocale_r (_REENT, LC_CTYPE, "C");

Does initial_setlocale() still need to save and possibly restore the
old locale given that it's immediately followed by the _setlocale_r


More information about the Cygwin-developers mailing list