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

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

Re: Display problem on Windows with time zones containing Non-ASCII char


From: Jason Rumney
Subject: Re: Display problem on Windows with time zones containing Non-ASCII characters.
Date: Wed, 06 Jun 2007 00:48:31 +0100
User-agent: Thunderbird 2.0.0.0 (Windows/20070326)

Jason Rumney wrote:
> So the same bug must have been reported in the past for the Japanese
> locale on W32, but we covered it over by rejecting non alphanumeric
> timezone names rather than fixing the bug by decoding them using
> locale_coding_system.

I think the following change should fix the problem. Can anyone more
familiar with the coding functions confirm that I am doing this
correctly. Some of the calls to code_convert_string_norecord use
make_unibyte_string rather than build_string, but I can't figure out
when it is appropriate to do one not the other - or are they equivalent?


*** editfns.c    09 May 2007 10:32:39 +0100    1.439.2.1
--- editfns.c    06 Jun 2007 00:42:04 +0100   
***************
*** 1974,1979 ****
--- 1974,1981 ----
        int offset = tm_diff (t, &gmt);
        char *s = 0;
        char buf[6];
+       Lisp_Object name;
+
  #ifdef HAVE_TM_ZONE
        if (t->tm_zone)
      s = (char *)t->tm_zone;
***************
*** 1984,2002 ****
  #endif
  #endif /* not HAVE_TM_ZONE */
 
- #if defined HAVE_TM_ZONE || defined HAVE_TZNAME
-       if (s)
-     {
-       /* On Japanese w32, we can get a Japanese string as time
-          zone name.  Don't accept that.  */
-       char *p;
-       for (p = s; *p && (isalnum ((unsigned char)*p) || *p == ' '); ++p)
-         ;
-       if (p == s || *p)
-         s = NULL;
-     }
- #endif
-
        if (!s)
      {
        /* No local time zone name is available; use "+-NNNN" instead.  */
--- 1986,1991 ----
***************
*** 2004,2010 ****
        sprintf (buf, "%c%02d%02d", (offset < 0 ? '-' : '+'), am/60, am%60);
        s = buf;
      }
!       return Fcons (make_number (offset), Fcons (build_string (s), Qnil));
      }
    else
      return Fmake_list (make_number (2), Qnil);
--- 1993,2002 ----
        sprintf (buf, "%c%02d%02d", (offset < 0 ? '-' : '+'), am/60, am%60);
        s = buf;
      }
!       name = code_convert_string_norecord (build_string (s),
!                                            Vlocale_coding_system, 0);
!
!       return Fcons (make_number (offset), name, Qnil));
      }
    else
      return Fmake_list (make_number (2), Qnil);





reply via email to

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