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

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

format-time-string results invalid char with %a of Chinses Monday


From: Du Jingwu
Subject: format-time-string results invalid char with %a of Chinses Monday
Date: Mon, 4 Sep 2006 15:42:07 +0800
User-agent: KMail/1.9.1

My system locale is zh_CN.GB18030 and I'm using GNU Emacs 23 CVS.
An example saves thousand words:

1. (format-time-string "<%Y-%m-%d %a>" '(17539 62058 675709))
The expected character is Chinese character of "one". But the result is a 
strange character like 'h'. Here's the describe-char info of this strange 
char:
--------------8<-------------8<-----------------
        character: h (1211, #o2273, #x4bb)
preferred charset: gb18030 (GB18030)
       code point: 0x8130DD35
           syntax: w    which means: word
         category: y:Cyrillic
      buffer code: #xD2 #xBB
        file code: #x81 #x30 #xDD #x35 (encoded by coding system 
chinese-gb18030-unix)
          display: by this font (glyph code)
     -Misc-Fixed-Medium-R-Normal--14-130-75-75-C-70-ISO10646-1 (#x4BB)
--------------8<-------------8<-----------------

The correct one (Chinese Monday character) should be:

--------------8<-------------8<-----------------
        character: ?? (19968, #o47000, #x4e00)
preferred charset: gb18030 (GB18030)
       code point: 0xD2BB
           syntax: w    which means: word
         category: C:Chinese (Han) characters of 2-byte character sets 
c:Chinese h:Korean j:Japanese
                   |:While filling, we can break a line at this character.
      buffer code: #xE4 #xB8 #x80
        file code: #xD2 #xBB (encoded by coding system chinese-gb18030-unix)
          display: by this font (glyph code)
     -ISAS-Fangsong ti-Medium-R-Normal--16-160-72-72-c-160-GB2312.1980-0 
(#x523B)
--------------8<-------------8<-----------------

2. (format-time-string "<%Y-%m-%d %a %p>" '(17539 62058 675709))
The Chinese character of "one" shows correctly.

I find out that, if there're Chinese characters after %a, the result is OK. 
That's to say, if the %p is replaced with %Y, or %m, the result is not 
correct again.

3. (format-time-string "<%Y-%m-%d %a>" '(17540 62058 675709))
The Chinese character of "two" shows correctly.

That's really strange. It may be a encoding bug?

My emacs info:
In GNU Emacs 23.0.0.10 (i686-pc-linux-gnu, X toolkit, Xaw3d scroll bars)
 of 2006-08-22 on levcom
X server distributor `The X.Org Foundation', version 11.0.60900000
Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: zh_CN.GB18030
  locale-coding-system: chinese-gb18030
  default-enable-multibyte-characters: t

Best Regards,
Levin Du




reply via email to

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