[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: emacs 21.1 writes invalidly encoded ISO-2022-JP-2 files
From: |
Kenichi Handa |
Subject: |
Re: emacs 21.1 writes invalidly encoded ISO-2022-JP-2 files |
Date: |
Mon, 25 Feb 2002 14:20:15 +0900 (JST) |
User-agent: |
SEMI/1.14.3 (Ushinoya) FLIM/1.14.2 (Yagi-Nishiguchi) APEL/10.2 Emacs/21.1.30 (sparc-sun-solaris2.6) MULE/5.0 (SAKAKI) |
Bruno Haible <haible@ilog.fr> writes:
> The reason is that the saved file (de.po, attached) is in fact
> invalid. It contains in line 22 a G2 designation for ISO-8859-1 (ESC
> . A) and a use of it (ESC N ;), and later in line 27 a use of G2 (ESC
> N ;) without prior designation on the same line. But the document
> which defines ISO-2022-JP-2, RFC 1554, says:
> At the beginning of a line, information on G2 designation of the
> previous line is cleared. New designation must be given before a
> character in 96 character sets is used in the line.
Yes. This is a bug of Emacs. iso-2022-jp-2 must be defined
with flag `init-bol'.
---- from docstring of make-coding-system ----------------------------
FLAGS specifies more detailed information of the coding system as follows:
If TYPE is 2 (ISO-2022), FLAGS is a list of these elements:
[...]
INIT-BOL non-nil means any designation state is assumed to be reset
to initial at each beginning of line on output.
----------------------------------------------------------------------
I remembered I fixed this bug looooong ago (in Emacs 20.x).
But, there's no ChangeLog entry for that. Hmmm, perhaps, I
fixed it only locally. :-(
Anyway, this is the current definitioin of iso-2022-jp-2 (in
lisp/language/japanese.el).
(make-coding-system
'iso-2022-jp-2 2 ?J
"ISO 2022 based 7bit encoding for CJK, Latin-1, and Greek
(MIME:ISO-2022-JP-2)."
'((ascii japanese-jisx0208-1978 japanese-jisx0208
latin-jisx0201 japanese-jisx0212
chinese-gb2312 korean-ksc5601) nil
(nil latin-iso8859-1 greek-iso8859-7) nil
short ascii-eol ascii-cntl seven nil single-shift)
'((safe-charsets ascii japanese-jisx0208-1978 japanese-jisx0208
latin-jisx0201 japanese-jisx0212
chinese-gb2312 korean-ksc5601
latin-iso8859-1 greek-iso8859-7)
(mime-charset . iso-2022-jp-2)))
We must insert " nil nil nil init-bol" after "single-shift".
Could you please try it?
To Emacs maintainers, could someone please install this fix.
---
Ken'ichi HANDA
handa@etl.go.jp