[Top][All Lists]

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

Re: [bug-gettext] cygwin started speaking German today

From: Charles Wilson
Subject: Re: [bug-gettext] cygwin started speaking German today
Date: Wed, 07 Sep 2011 22:30:08 -0400
User-agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv: Gecko/20090812 Thunderbird/ Mnenhy/

[for the bug-gnu-gettext list, this thread started here:
and was posted immediately after the release of gettext- for
cygwin (which had not been updated since 0.17).

On 30.08.2011 06:18, Voelker, Bernhard wrote:
> Starting with today's update, cygwin started speaking German:
> $ mkdir -v x0
> mkdir: Verzeichnis „x0“ angelegt
> $ LANG=C mkdir -v x2
> mkdir: created directory `x2'
> $ LANG=C.UTF-8 mkdir -v x1
> mkdir: Verzeichnis „x1“ angelegt
> Default is LANG=C.UTF-8 here.
> Ok, the PC is in Germany, but none of my environment
> variables have a 'de' inside.

I can reproduce this behavior; the workaround for now is to use $LC_ALL
or $LC_CTYPE instead of $LANG.

I think I have an inkling about what is causing this problem -- but I'm
not real clear on how to fix it.  The issue is, (new) libintl implements
its own [libintl_]setlocale function, which eventually calls the cygwin
setlocale.  The old libintl did neither of those things.

Now, under the old mechanism, cygwin's setlocale() was called directly
(by the app), and cygwin::setlocale did its magic with the LC_ALL,
LC_CTYPE, and/or LANG variables.

However, *new* libintl now, I think, calls its own [libintl_]setlocale
replacement internally, and that messes up the effect of the
application's own direct-to-cygwin's setlocale() call.

I think it is because libintl_setlocale() will not allow
cygwin::setlocale() to exercise its default behavior wrt $LANG, since it
*always* calls the underlying OS setlocale with a specific LC_????
subtype, never LC_ALL -- and always with a specific locale string, never
"". (I think)

I've attached a compressed copy of the setlocale implementation, if
anybody (CALL FOR HELP) can suggest a mechanism -- or better, provide a
patch -- to make libintl_setlocale Do The Right Thing on cygwin.


Attachment: setlocale.c.xz
Description: Binary data

reply via email to

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