Subject: Re: cygwin started speaking German today
From: Bruno Haible <[email-masked]>
To: Charles Wilson <[email-masked]>, Bernhard Voelker <[email-masked]>
Cc: [email-masked], [email-masked]
Date: Thu, 8 Sep 2011 12:46:22 +0200
List-Id: <cygwin.cygwin.com>

Bernhard Voelker 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.

This is as it should be. See the NEWS entry from the gettext package:

* Runtime behaviour:
  - On MacOS X and Windows systems, <libintl.h> now extends setlocale() and
    newlocale() so that their determination of the default locale considers
    the choice the user has made in the system control panels.

'mkdir' is a GNU coreutils programs, which uses <libintl.h>, so it gets
the benefit of libintl enhancements.

After Cygwin 1.7 added working locales and defined LANG=C.UTF-8 for all users,
libintl could be extended to respect the choices the user has made in the
system control panels.

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

Which of the three environment variables you use, should not make a difference.
If it does, it's a bug in libintl or in the program. Can you show how to
reproduce this, please?

> I'm not real clear on how to fix it.

There is nothing to "fix". Users who don't want internationalization system-wide
can set their locale in the "Regional Settings" control panel to English.
Users who want to have a German Windows but a non-internationalized Cygwin can
set LANG=C or LC_ALL=C - exactly like POSIX specifies.

> 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.

There is nothing to change in cygwin's setlocale implementation, nor in
libintl_setlocale. Both are POSIX compliant. The one in libintl is more
adequate for internationalized programs (given the fact that Cygwin sets
LANG to C.UTF-8 and not de_DE.UTF-8 as would be appropriate in a German
environment).

Bruno
-- 
In memoriam Elisabeth von Thadden <http://en.wikipedia.org/wiki/Elisabeth_von_Thadden>

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple