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

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

Re: `.newsrc.eld' saves chinese group name in wrong coding


From: Kenichi Handa
Subject: Re: `.newsrc.eld' saves chinese group name in wrong coding
Date: Thu, 19 Oct 2006 13:48:55 +0900
User-agent: SEMI/1.14.3 (Ushinoya) FLIM/1.14.2 (Yagi-Nishiguchi) APEL/10.2 Emacs/22.0.50 (i686-pc-linux-gnu) MULE/5.0 (SAKAKI)

Sorry for the late response on this matter.

In article <address@hidden>, Zhang Wei <address@hidden> writes:

> [1  <text/plain (7bit)>]
> `.newsrc.eld' can't save chinese group name in proper coding. When gnus
> is restarted, all of the articles in groups with chinese name are marked
> unread. But enter that group, you will find all of the articles are old
> articles (marked by an `O'). The file in the attachment is the wrong
> formatted `.newsrc.eld', hope that will be helpful.

> Same problem with Emacs22 and emacs-unicode-2.

> [2 .newsrc.eld <text/plain (quoted-printable)>]
> ;; -*- mode:emacs-lisp; coding: utf-8-emacs-dos; -*-
> ;; Gnus startup file.
> ;; Never delete this file -- if you want to force Gnus to read the
> ;; .newsrc file (if you have one), touch .newsrc instead.
> (setq gnus-newsrc-file-version "Gnus v5.11")
> (setq gnus-newsrc-last-checked-date '"Sun, 20 Aug 2006 14:34:25 +0800")
> (setq gnus-newsrc-alist 
> '(("\301\367\320\30799.\261\276\265\330\262\342\312\324" 3 ((1 . 8))

It seems that Gnus prints a unibyte string (perhaps created
by encoding the original string "流星99.本地测试" by gb2312,
or created by reading an external gb2312 data (filename?)
without decoding) in a work buffer by `print', and then
saves that buffer.

There are two problems here.  The first one is to use
`print' (or `prin1') on a form that contains a unibyte
string.  This leads to the byte sequence '\\' '3' '0' '1'
for the byte \301 of an unibyte string.  Next, the encoding
of unibyte string (gb2312) doesn't match with the coding tag
(utf-8-emacs).

I think the correct fix is to print a form containing a
multibyte string, and then encode the buffer on saving with
a coding system that match with the coding tag.

---
Kenichi Handa
address@hidden

reply via email to

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