From: Paul Eggert <eggert@cs.ucla.edu>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 9794@debbugs.gnu.org
Subject: bug#9794: 24.0.90; `format-time-string' no good for %Z
Date: Thu, 20 Oct 2011 00:48:02 -0700 [thread overview]
Message-ID: <4E9FD232.9090502@cs.ucla.edu> (raw)
In-Reply-To: <83pqhtt144.fsf@gnu.org>
On 10/19/11 09:08, Eli Zaretskii wrote:
> Paul, would such a change be acceptable by gnulib?
That's a looooong story. I went through the cited bug reports
and found three problems:
1. The original problem dates back to my 1999-10-19 patch to
editfns.c. This patch fixed several problems by adding
conversions between Emacs's string encoding and the underlying
system's encoding for strings. The patch added conversions for
several functions, including format-time-string, but it did not
alter current-time-zone, because I didn't think of the possibility
that time zone names might be non-ASCII on some platforms.
Michael Schierl reported the current-time-zone issue to RMS in 2007; see
<http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
But somehow the light bulb didn't go off, and current-time-zone
wasn't fixed. Instead a workaround was installed, which basically
said "On Windows, don't ever generate time zone names, because
they might contain non-ASCII characters."
Now that I see this problem, I have changed current-time-zone so
that it converts non-ASCII characters properly, which is what
Schierl's bug report was actually about. I installed the fix in
the trunk, as bzr 106149.
2. Because of the 2007 workaround, in the Windows port
(format-time-string "%Z") always generates an empty string. This
is obviously wrong and is not what users expect, and should be
fixed by reverting the Windows part of the 2007 workaround, which
we can safely do now that the current-time-zone bug has been
fixed. Your patch to nt/config.nt should do this, and I agree
it should be installed. (There is no need to change lib/strftime.c.)
3. There is some talk in the bug reports about time zone names and
RFC822 compliance. But time zone names in general do not conform
to RFC822. For example, on a POSIX host if you set the TZ
environment variable as follows:
TZ="<-8+>0"
then (format-time-string "%Z") returns "-8+", and that's
the correct value, even if it's not an RFC822 zone.
Any code that assumes that (format-time-string "%Z") must generate
an RFC822 zone is making an unwarranted assumption and should be
fixed. I did a quick scan for such code in Emacs and didn't find
any. Perhaps there's some out-of-Emacs Lisp code that's making
the assumption, but if so, that code needs to be fixed because
in general it does not work and has never worked.
next prev parent reply other threads:[~2011-10-20 7:48 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-19 6:44 bug#9794: 24.0.90; `format-time-string' no good for %Z Drew Adams
2011-10-19 7:43 ` Drew Adams
2011-10-19 8:33 ` Eli Zaretskii
2011-10-19 13:20 ` Jason Rumney
2011-10-19 14:28 ` Drew Adams
2011-10-19 15:26 ` Eli Zaretskii
2011-10-19 16:08 ` Eli Zaretskii
2011-10-20 7:48 ` Paul Eggert [this message]
2011-10-20 9:24 ` Eli Zaretskii
2011-10-20 9:46 ` Andreas Schwab
2011-10-20 10:05 ` Eli Zaretskii
2011-10-20 10:10 ` Andreas Schwab
2011-10-20 10:49 ` Eli Zaretskii
2011-10-20 11:22 ` Andreas Schwab
2011-10-20 12:58 ` Eli Zaretskii
2011-10-20 13:06 ` Andreas Schwab
2011-10-20 13:18 ` Eli Zaretskii
2011-10-20 15:23 ` Paul Eggert
2011-10-20 16:03 ` Eli Zaretskii
2011-10-21 15:40 ` Jason Rumney
2011-10-21 17:34 ` Paul Eggert
2011-10-22 9:21 ` bug#641: " Eli Zaretskii
2011-10-19 14:29 ` Drew Adams
2011-10-19 15:13 ` Eli Zaretskii
2011-10-19 7:47 ` Eli Zaretskii
2011-10-19 14:28 ` Drew Adams
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4E9FD232.9090502@cs.ucla.edu \
--to=eggert@cs.ucla.edu \
--cc=9794@debbugs.gnu.org \
--cc=eliz@gnu.org \
/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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).