all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Paul W. Rankin <hello@paulwrankin.com>
To: Paul Eggert <eggert@cs.ucla.edu>
Cc: 39248@debbugs.gnu.org
Subject: bug#39248: format-time-string ignores user's preferred locale
Date: Thu, 23 Jan 2020 23:12:39 +1000	[thread overview]
Message-ID: <68077D50-2E85-4FB7-92EF-96C636D6DE6E@paulwrankin.com> (raw)
In-Reply-To: <c575c2ab-11d6-119c-4b34-a5052a9f1253@cs.ucla.edu>

Thanks for looking into this for me.

> On 23 Jan 2020, at 6:38 pm, Paul Eggert <eggert@cs.ucla.edu> wrote:
> 
> Thanks for the bug report. I don't observe the problem on GNU/Linux; for example, the following shell command:
> 
> LC_ALL=en_AU.utf8 emacs -Q -batch -eval '(message "%s" (format-time-string "%x"))'

This outputs "01/23/20" for me. But I think this is because "utf8" vs "utf-8", e.g.

LC_ALL=en_au.utf-8 emacs -Q -batch -eval '(message "%s" (format-time-string "%x"))'
-> 23/01/2020

Which would indicate that macOS only recognises "utf-8" not "utf8".

LC_ALL=en_AU.utf8 date +%x
-> 01/23/20
LC_ALL=en_AU.utf-8 date +%x
-> 23/01/2020

I should note though that the issue only presents from Emacs.app i.e. when launched from Finder.

Even when launching Emacs.app via
/Applications/Emacs.app/Contents/MacOS/Emacs -Q
I can get the correct date.

It's solely when the app is launched from Finder i.e. outside the shell. AFAIK this means there's no way for me to launch Emacs.app outside of the shell with the -Q flag and so I moved my init files out of the way for a clean launch and reproduced that way.

I've also reproduced on Emacs.app versions 24 and 25. (It's actually an issue that has bothered me for years.)


> I suggest that you build Emacs with debug symbols and with optimization off (e.g., "make clean; make CFLAGS='-g3 -O0'"), and then run it under a debugger, and plant a breakpoint on the nstrftime function and then single-step and see what goes wrong. Something like this:
> 
> $ make clean
> $ make CFLAGS='-g3 -O0'
> $ gdb src/emacs
> (gdb) b nstrftime
> (gdb) r -Q -batch -eval '(message "%s" (format-time-string "%x"))'
> (gdb) n
> (gdb) n
> ...

I installed gdb and followed these steps, but I get a codesigning error; apparently in order to function on macOS, gdb requires some "code-signing" steps that are beyond my competency level.

Is there another way to test the strftime function?

Or, given that the issue is isolated to Emacs.app when launched outside of the shell environment, does that narrow it down at all?







  reply	other threads:[~2020-01-23 13:12 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-23  3:48 bug#39248: format-time-string ignores user's preferred locale Paul W. Rankin
2020-01-23  5:56 ` Eli Zaretskii
2020-01-23  6:44   ` Paul W. Rankin
2020-01-23 14:19     ` Eli Zaretskii
2020-01-23  8:38 ` Paul Eggert
2020-01-23 13:12   ` Paul W. Rankin [this message]
2020-01-23 18:05     ` Eli Zaretskii
2020-01-23 22:04       ` Glenn Morris
2020-01-24  3:17         ` Paul W. Rankin
2020-01-24  7:35           ` Paul Eggert
2020-01-25  9:36             ` Paul W. Rankin
2020-01-25 11:18             ` Alan Third
2020-01-25 11:42               ` Paul W. Rankin
2020-01-25 12:03                 ` Alan Third
2020-01-26  8:35               ` Paul Eggert
2020-01-26 10:26                 ` Alan Third

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=68077D50-2E85-4FB7-92EF-96C636D6DE6E@paulwrankin.com \
    --to=hello@paulwrankin.com \
    --cc=39248@debbugs.gnu.org \
    --cc=eggert@cs.ucla.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.