CYGWIN=codepage? Or LC_CTYPE=foo?

Corinna Vinschen corinna-cygwin@cygwin.com
Mon Apr 7 10:04:00 GMT 2008


On Apr  6 12:28, Brian Dessent wrote:
> Corinna Vinschen wrote:
> 
> > 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:
> > 
> > http://www.microsoft.com/globaldev/nlsweb/default.mspx
> > 
> > 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.
> 
> How about a standalone program that reads what the Windows locale is set
> to and echos the equivalent setting for LANG to stdout.  That can be
> added to the system /etc/profile such that LANG gets set at startup, and
> the user can override it if desired in their own $HOME/.profile or
> equivalent.  This lets us keep in sync with what the user has configured
> Windows to, but it keeps the logic outside of the DLL such that it can
> just use whatever LANG is set to.

I like the idea.

Should the tool just print "en_AU", or should it print "en_AU.UTF-8" to
make UTF-8 the default?  Or should that be an option of the tool?  Just
as a sidenote, some languages don't have a ANSI or OEM codepage attached
and are always running in UNICODE mode.  For these the choice is clear.

What about calling this tool only once in a postinstall script and
creating a file /etc/sysconfig/i18n from the output which then gets
evaluated in /etc/profile.d/lang.sh or lang.csh?


Corinna

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