From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.bugs Subject: bug#9794: 24.0.90; `format-time-string' no good for %Z Date: Thu, 20 Oct 2011 00:48:02 -0700 Organization: UCLA Computer Science Department Message-ID: <4E9FD232.9090502@cs.ucla.edu> References: <68A313A7DDAA4912A255DAFE495606F9@us.oracle.com> <24FDB65B0E784E978085D30A7CBF9FAF@us.oracle.com> <8362jlv0rq.fsf@gnu.org> <87fwipgltl.fsf@gnu.org> <83pqhtt144.fsf@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1319096951 1798 80.91.229.12 (20 Oct 2011 07:49:11 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 20 Oct 2011 07:49:11 +0000 (UTC) Cc: 9794@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Oct 20 09:49:07 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RGnN7-0000GK-PF for geb-bug-gnu-emacs@m.gmane.org; Thu, 20 Oct 2011 09:49:02 +0200 Original-Received: from localhost ([::1]:34715 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RGnN7-0000c9-Ae for geb-bug-gnu-emacs@m.gmane.org; Thu, 20 Oct 2011 03:49:01 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:35287) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RGnN3-0000c0-Lz for bug-gnu-emacs@gnu.org; Thu, 20 Oct 2011 03:48:59 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RGnN2-0002dC-0S for bug-gnu-emacs@gnu.org; Thu, 20 Oct 2011 03:48:57 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:39481) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RGnN1-0002cy-QZ for bug-gnu-emacs@gnu.org; Thu, 20 Oct 2011 03:48:55 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1RGnO6-0002bg-E2 for bug-gnu-emacs@gnu.org; Thu, 20 Oct 2011 03:50:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Paul Eggert Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 20 Oct 2011 07:50:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 9794 X-GNU-PR-Package: emacs,w32 X-GNU-PR-Keywords: Original-Received: via spool by 9794-submit@debbugs.gnu.org id=B9794.13190969619969 (code B ref 9794); Thu, 20 Oct 2011 07:50:02 +0000 Original-Received: (at 9794) by debbugs.gnu.org; 20 Oct 2011 07:49:21 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RGnNQ-0002ak-MR for submit@debbugs.gnu.org; Thu, 20 Oct 2011 03:49:20 -0400 Original-Received: from smtp.cs.ucla.edu ([131.179.128.62]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RGnNM-0002aW-Py for 9794@debbugs.gnu.org; Thu, 20 Oct 2011 03:49:19 -0400 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id 2F5A7A60002; Thu, 20 Oct 2011 00:48:04 -0700 (PDT) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Original-Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id r76aftZrg0+H; Thu, 20 Oct 2011 00:48:03 -0700 (PDT) Original-Received: from [192.168.1.10] (pool-71-189-109-235.lsanca.fios.verizon.net [71.189.109.235]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 6A81339E8006; Thu, 20 Oct 2011 00:48:03 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.23) Gecko/20110922 Thunderbird/3.1.15 In-Reply-To: <83pqhtt144.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Thu, 20 Oct 2011 03:50:02 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:52902 Archived-At: 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 . 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.