On Fri, Aug 19, 2016 at 07:39:06AM +0200, Matthias Apitz wrote:
> El día Thursday, August 18, 2016 a las 05:35:22PM -0500, Derek Martin 
> escribió:
> 
> > On Thu, Aug 18, 2016 at 09:48:31AM +0200, Matthias Apitz wrote:
> > > I have had in my ~/.muttrc file
> > > set locale="es_ES"
> > 
> > DO NOT SET MUTT'S LOCALE, unless you really, really know what you're
> > doing.  Let your operating system set it for you, unless you really,
> > really know what you're doing.  It causes silly problems exactly like
> > this one... unless you really, really know what you're doing.
> 
> If I unset it in ~/.muttrc and run
> 
> $ LANG=es_ES.UTF-8 LC_ALL=es_ES.UTF-8 LC_TIME=es_ES.UTF-8 mutt
> 
> it gives the month name as 'Aug', which is not correct.

I'm a bit confused by the mutt source code here.  The default value of
$locale is "C", and the code around the index date formatting is calling
        if (do_locales && Locale)
          setlocale (LC_TIME, Locale);
        strftime (buf2, sizeof (buf2), dest, tm);
        if (do_locales)
          setlocale (LC_TIME, "C");
(a leading '!' in the %{...} disables locales, thus the do_locales check).

Some other parts of the code are (more correctly) calling:
    setlocale (LC_TIME, "");
    strftime (p, sizeof (p), _(" (current time: %c)"), localtime (&t));
    setlocale (LC_TIME, "C");

The documentation for setlocale() says a value of "" will cause the
locale to be modified by environment variables, so it seems like this is
what we would want in the index, isn't it?

Shouldn't $locale default to ""?

-- 
Kevin J. McCarthy
GPG Fingerprint: 8975 A9B3 3AA3 7910 385C  5308 ADEF 7684 8031 6BDA

Attachment: signature.asc
Description: PGP signature

Reply via email to