help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Autogen in Emacs Shell


From: Eli Zaretskii
Subject: Re: Autogen in Emacs Shell
Date: Fri, 01 May 2015 20:49:52 +0300

> Date: Fri, 1 May 2015 19:06:09 +0200
> From: Alexander Shukaev <haroogan@gmail.com>
> Cc: help-gnu-emacs <help-gnu-emacs@gnu.org>, Eli Zaretskii <eliz@gnu.org>
> 
> Right, so explicitly doing
> 
> (setenv "LANG" "en_US.UTF-8")
> 
> solves both problems at once. Interesting... Do you have any comments on that?
> Maybe clarifications on why this problem occurs? For instance, why `LANG' is
> properly set in ConEmu, while in Emacs it has value `ENU'?

Because the Windows locale names are different from Posix locale
names.

> Where does this even come from?

>From w32.c:init_environment:

  /* Get default locale info and use it for LANG.  */
  if (GetLocaleInfo (LOCALE_USER_DEFAULT,
                     LOCALE_SABBREVLANGNAME | LOCALE_USE_CP_ACP,
                     locale_name, sizeof (locale_name)))
    {
      for (i = 0; i < N_ENV_VARS; i++)
        {
          if (strcmp (env_vars[i].name, "LANG") == 0)
            {
              env_vars[i].def_value = locale_name;
              break;
            }
        }
    }

> Is it OK to do
> 
> (setenv "LANG" "en_US.UTF-8")

Not if you want the rest of locale-specific code in Emacs itself to
work, no.

Why does a native Windows program such as bsdtar expect a Posix-style
locale spec?  It's a bug, IMO.  The MS-Windows implementation of
'setlocale' will not work with Posix locale specs.

> or there is some other more generic way?

There's no generic way.  Locale names and specifications are not
portable between Posix and non-Posix systems.



reply via email to

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