CYGWIN=codepage? Or LC_CTYPE=foo?

Corinna Vinschen
Sun Apr 6 14:40:00 GMT 2008

On Apr  6 13:13, Corinna Vinschen wrote:
> So, given my vague understanding of this language stuff, the conversion
> from wide char to multibyte string *can* be based on the notion the
> applications have of the language/codepage.  Which sounds to me as if
> using LANG/LC_CTYPE would also make sense for Cygwin's internal
> conversions.

And while I already confused myself no end, here's another question.

Shouldn't the (default) setting of LANG, LC_CTYPE and friends be based
on what the underlying OS is set to?  Microsoft maintains a table which
defines the relationship between the locale identifier used internally
(LCID), the "Culture name" (what's used by POSIX) and the attached
codepage.  The list is here:

In theory we could fetch the current LCID and set $LANG and the
internally used codepage according to the table.

Or, we check if LANG/LC_CTYPE is set and only set the codepage according
to the setting of these variables.  Otherwise we just use the default
ANSI codepage.


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