bash and the current locale implementation

Corinna Vinschen
Thu Oct 1 11:16:00 GMT 2009

On Oct  1 04:50, Eric Blake wrote:
> According to Corinna Vinschen on 10/1/2009 4:28 AM:
> > 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.

> > Same goes for dash, btw, but it isn't locale-aware anyway.
> dash prides itself on being as small as possible; I'm not going out of my
> way to change that by adding locale support.

Sure enough.


Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

More information about the Cygwin-developers mailing list