Gnus development mailing list
 help / color / mirror / Atom feed
* PATCH for mm-util.el
@ 1998-11-24  1:59 Katsumi Yamaoka
  1998-11-24  6:30 ` Shenghuo ZHU
  1998-11-24 10:21 ` Lars Magne Ingebrigtsen
  0 siblings, 2 replies; 11+ messages in thread
From: Katsumi Yamaoka @ 1998-11-24  1:59 UTC (permalink / raw)


It seems that coding systems and MIME charsets are confused in
mm-decode-coding-* and mm-encode-coding-*. Please apply the following
patch if it is appropriate.

--- pgnus-0.53/lisp/mm-util.el~	Sat Nov 21 17:51:18 1998
+++ pgnus-0.53/lisp/mm-util.el	Tue Nov 24 10:37:42 1998
@@ -75,11 +75,7 @@
        (if (fboundp (car elem))
 	   (fset nfunc (car elem))
 	 (fset nfunc (cdr elem)))))
-   '((decode-coding-string . (lambda (s a) s))
-     (encode-coding-string . (lambda (s a) s))
-     (encode-coding-region . ignore)
-     (coding-system-list . ignore)
-     (decode-coding-region . ignore)
+   '((coding-system-list . ignore)
      (char-int . identity)
      (device-type . ignore)
      (coding-system-equal . equal)
@@ -94,6 +90,36 @@
 	  (completing-read
 	   prompt (mapcar (lambda (s) (list (symbol-name (car s))))
 			  mm-mime-mule-charset-alist)))))))
+
+(eval-and-compile
+  (mapcar
+   (lambda (elem)
+     (let ((nfunc (intern (format "mm-%s" (car elem)))))
+       (if (fboundp (car elem))
+	   (fset nfunc (cadr elem))
+	 (fset nfunc (caddr elem)))))
+   '((decode-coding-string
+      (lambda (string coding-system-or-mime-charset)
+	(decode-coding-string
+	 string (mm-charset-to-coding-system coding-system-or-mime-charset)))
+      (lambda (s a) s))
+     (encode-coding-string
+      (lambda (string coding-system-or-mime-charset)
+	(encode-coding-string
+	 string (mm-charset-to-coding-system coding-system-or-mime-charset)))
+      (lambda (s a) s))
+     (encode-coding-region
+      (lambda (start end coding-system-or-mime-charset)
+	(encode-coding-region
+	 start end
+	 (mm-charset-to-coding-system coding-system-or-mime-charset)))
+      ignore)
+     (decode-coding-region
+      (lambda (start end coding-system-or-mime-charset)
+	(decode-coding-region
+	 start end
+	 (mm-charset-to-coding-system coding-system-or-mime-charset)))
+      ignore))))
 
 (defvar mm-coding-system-list nil)
 (defun mm-get-coding-system-list ()
-- 
Katsumi Yamaoka <yamaoka@jpl.org>



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: PATCH for mm-util.el
  1998-11-24  1:59 PATCH for mm-util.el Katsumi Yamaoka
@ 1998-11-24  6:30 ` Shenghuo ZHU
  1998-11-24  6:51   ` Katsumi Yamaoka
  1998-11-24 10:21 ` Lars Magne Ingebrigtsen
  1 sibling, 1 reply; 11+ messages in thread
From: Shenghuo ZHU @ 1998-11-24  6:30 UTC (permalink / raw)


>>>>> "KY" == Katsumi Yamaoka <yamaoka@jpl.org> writes:

KY> It seems that coding systems and MIME charsets are confused in
KY> mm-decode-coding-* and mm-encode-coding-*. Please apply the
KY> following patch if it is appropriate.

Yes, coding systems, mule charsets, and MIME charsets are confusing.
But, IMHO, your solution makes them more confusing and slows down the
de/encoding processes.

-- 
Shenghuo


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: PATCH for mm-util.el
  1998-11-24  6:30 ` Shenghuo ZHU
@ 1998-11-24  6:51   ` Katsumi Yamaoka
  0 siblings, 0 replies; 11+ messages in thread
From: Katsumi Yamaoka @ 1998-11-24  6:51 UTC (permalink / raw)


>>>>> In <2nbtlx1u32.fsf@zsh.cs.rochester.edu> 
>>>>>	Shenghuo ZHU <zsh@cs.rochester.edu> wrote:

KY> It seems that coding systems and MIME charsets are confused in
KY> mm-decode-coding-* and mm-encode-coding-*.

ZSH> Yes, coding systems, mule charsets, and MIME charsets are confusing.
ZSH> But, IMHO, your solution makes them more confusing and slows down the
ZSH> de/encoding processes.

I think so. :-)
Well, let's make new functions, e.g. mm-decode-mime-charset-*, ...
-- 
Katsumi Yamaoka <yamaoka@jpl.org>



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: PATCH for mm-util.el
  1998-11-24  1:59 PATCH for mm-util.el Katsumi Yamaoka
  1998-11-24  6:30 ` Shenghuo ZHU
@ 1998-11-24 10:21 ` Lars Magne Ingebrigtsen
  1998-11-24 10:53   ` Katsumi Yamaoka
  1 sibling, 1 reply; 11+ messages in thread
From: Lars Magne Ingebrigtsen @ 1998-11-24 10:21 UTC (permalink / raw)


Katsumi Yamaoka <yamaoka@jpl.org> writes:

> It seems that coding systems and MIME charsets are confused in
> mm-decode-coding-* and mm-encode-coding-*.

I don't see quite what's confusing if I've understood things
correctly, which I probably haven't.  :-)

A MULE "coding system" is the same thing as a MIME "charset".  

Isn't it?

If not, I can understand the confusion.

(Well, to be totally precise, MULE "coding systems" are a superset of
MIME "charsets", since you may consider, say, gzip to be a coding
system, but then you have to decode coding systems more than once,
which is something the MULE in Emacs 20.3 isn't well-disposed to
doing, so in practice they are the same.)

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: PATCH for mm-util.el
  1998-11-24 10:21 ` Lars Magne Ingebrigtsen
@ 1998-11-24 10:53   ` Katsumi Yamaoka
  1998-11-24 11:24     ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 11+ messages in thread
From: Katsumi Yamaoka @ 1998-11-24 10:53 UTC (permalink / raw)


>>>>> In <m3iug5o0h5.fsf@sparky.gnus.org> 
>>>>>	Lars Magne Ingebrigtsen <larsi@gnus.org> wrote:

> It seems that coding systems and MIME charsets are confused in
> mm-decode-coding-* and mm-encode-coding-*.

Lars> I don't see quite what's confusing if I've understood things
Lars> correctly, which I probably haven't.  :-)
Lars> A MULE "coding system" is the same thing as a MIME "charset".  
Lars> Isn't it?

For example, a MIME charset `iso-2022-jp-2' is not a MULE coding
system.

(decode-coding-string "\e$B$3$s$K$A$O\e(B" 'iso-2022-jp-2)
 => Invalid coding system: iso-2022-jp-2

It should be replaced to `iso-2022-7bit-ss2' under Emacs 20.
In addition `us-ascii', `gb2312', `cn-gb' and `x-ctext' are not MULE
coding system as well.
What have you make `mm-charset-coding-system-alist' for? :-)
-- 
Katsumi Yamaoka <yamaoka@jpl.org>


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: PATCH for mm-util.el
  1998-11-24 10:53   ` Katsumi Yamaoka
@ 1998-11-24 11:24     ` Lars Magne Ingebrigtsen
  1998-11-24 11:36       ` Katsumi Yamaoka
  0 siblings, 1 reply; 11+ messages in thread
From: Lars Magne Ingebrigtsen @ 1998-11-24 11:24 UTC (permalink / raw)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="iso-2022-jp-2", Size: 678 bytes --]

Katsumi Yamaoka <yamaoka@jpl.org> writes:

> (decode-coding-string "\e$B$3$s$K$A$O\e(B" 'iso-2022-jp-2)
>  => Invalid coding system: iso-2022-jp-2
> 
> It should be replaced to `iso-2022-7bit-ss2' under Emacs 20.

Isn't that a bug?

> In addition `us-ascii', `gb2312', `cn-gb' and `x-ctext' are not MULE
> coding system as well.

Ditto, I'd say.

> What have you make `mm-charset-coding-system-alist' for? :-)

Well, I've been wondering the same thing.  :-)

(decode-coding-string "\e$B$3$s$K$A$O\e(B" 'iso-2022-jp-2)
=> "^[$B$3$s$K$A$O^[(B"

This is under XEmacs 21, though.

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: PATCH for mm-util.el
  1998-11-24 11:24     ` Lars Magne Ingebrigtsen
@ 1998-11-24 11:36       ` Katsumi Yamaoka
  1998-11-24 16:14         ` Shenghuo ZHU
  0 siblings, 1 reply; 11+ messages in thread
From: Katsumi Yamaoka @ 1998-11-24 11:36 UTC (permalink / raw)


>>>>> In <m37lwlcp00.fsf@sparky.gnus.org> 
>>>>>	Lars Magne Ingebrigtsen <larsi@gnus.org> wrote:

>> (decode-coding-string "\e$B$3$s$K$A$O\e(B" 'iso-2022-jp-2)
>> => Invalid coding system: iso-2022-jp-2

Lars> Isn't that a bug?

I don't know.

Lars> (decode-coding-string "\e$B$3$s$K$A$O\e(B" 'iso-2022-jp-2)
=> "こんにちは"

Lars> This is under XEmacs 21, though.

It was not defined until quite recently, dated 1998-08-12 in ChangeLog.
-- 
Katsumi Yamaoka <yamaoka@jpl.org>


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: PATCH for mm-util.el
  1998-11-24 11:36       ` Katsumi Yamaoka
@ 1998-11-24 16:14         ` Shenghuo ZHU
  1998-11-24 19:55           ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 11+ messages in thread
From: Shenghuo ZHU @ 1998-11-24 16:14 UTC (permalink / raw)


>>>>> "KY" == Katsumi Yamaoka <yamaoka@jpl.org> writes:

>>>>> In <m37lwlcp00.fsf@sparky.gnus.org> 
>>>>>> Lars Magne Ingebrigtsen <larsi@gnus.org> wrote:

>>> (decode-coding-string "\e$B$3$s$K$A$O\e(B" 'iso-2022-jp-2)
>>> => Invalid coding system: iso-2022-jp-2

Lars> Isn't that a bug?

KY> I don't know.

No. iso-2022-jp-2 is MULE charset, not MULE coding system.

Similarly, the result of find-charset-region is a list of MULE
charsets, not coding systems. 

-- 
Shenghuo


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: PATCH for mm-util.el
  1998-11-24 16:14         ` Shenghuo ZHU
@ 1998-11-24 19:55           ` Lars Magne Ingebrigtsen
  1998-11-24 20:36             ` Shenghuo ZHU
  0 siblings, 1 reply; 11+ messages in thread
From: Lars Magne Ingebrigtsen @ 1998-11-24 19:55 UTC (permalink / raw)


Shenghuo ZHU <zsh@cs.rochester.edu> writes:

> >>> (decode-coding-string "\e$B$3$s$K$A$O\e(B" 'iso-2022-jp-2)
> >>> => Invalid coding system: iso-2022-jp-2
> 
> Lars> Isn't that a bug?
> 
> KY> I don't know.
> 
> No. iso-2022-jp-2 is MULE charset, not MULE coding system.

Are you sure?

(find-charset-region (point-min) (point-max))
=> (japanese-jisx0208 ascii)

on the message in question.  I've interpreted this to mean that
`japanese-jisx0208' is the MULE charset, and `iso-2022-jp-2' is the
MULE coding system/MIME charset.

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: PATCH for mm-util.el
  1998-11-24 19:55           ` Lars Magne Ingebrigtsen
@ 1998-11-24 20:36             ` Shenghuo ZHU
  1998-11-25  9:08               ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 11+ messages in thread
From: Shenghuo ZHU @ 1998-11-24 20:36 UTC (permalink / raw)


>>>>> "LMI" == Lars Magne Ingebrigtsen <larsi@gnus.org> writes:

LMI> Shenghuo ZHU <zsh@cs.rochester.edu> writes:
>> >>> (decode-coding-string "\e$B$3$s$K$A$O\e(B" 'iso-2022-jp-2)
>> >>> => Invalid coding system: iso-2022-jp-2

LMI> (find-charset-region (point-min) (point-max))
LMI> => (japanese-jisx0208 ascii)

LMI> on the message in question.  I've interpreted this to mean that
LMI> `japanese-jisx0208' is the MULE charset, and `iso-2022-jp-2' is the
LMI> MULE coding system/MIME charset.

iso-2022-jp is a MULE coding system in Gnu Emacs. But I can not find
iso-2022-jp-2.

I guess, it is an extension of iso-2022-jp. It includes a larger MULE
charsets, Latin, Chinese, Koran and of course Japanese.

So, is it a coding system of old MULE, but not supported by Gnu Emacs?

-- 
Shenghuo


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: PATCH for mm-util.el
  1998-11-24 20:36             ` Shenghuo ZHU
@ 1998-11-25  9:08               ` Lars Magne Ingebrigtsen
  0 siblings, 0 replies; 11+ messages in thread
From: Lars Magne Ingebrigtsen @ 1998-11-25  9:08 UTC (permalink / raw)


Shenghuo ZHU <zsh@cs.rochester.edu> writes:

> LMI> (find-charset-region (point-min) (point-max))
> LMI> => (japanese-jisx0208 ascii)
> 
> LMI> on the message in question.  I've interpreted this to mean that
> LMI> `japanese-jisx0208' is the MULE charset, and `iso-2022-jp-2' is the
> LMI> MULE coding system/MIME charset.
> 
> iso-2022-jp is a MULE coding system in Gnu Emacs. But I can not find
> iso-2022-jp-2.

It isn't in Emacs, but it's in XEmacs 21.

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~1998-11-25  9:08 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-11-24  1:59 PATCH for mm-util.el Katsumi Yamaoka
1998-11-24  6:30 ` Shenghuo ZHU
1998-11-24  6:51   ` Katsumi Yamaoka
1998-11-24 10:21 ` Lars Magne Ingebrigtsen
1998-11-24 10:53   ` Katsumi Yamaoka
1998-11-24 11:24     ` Lars Magne Ingebrigtsen
1998-11-24 11:36       ` Katsumi Yamaoka
1998-11-24 16:14         ` Shenghuo ZHU
1998-11-24 19:55           ` Lars Magne Ingebrigtsen
1998-11-24 20:36             ` Shenghuo ZHU
1998-11-25  9:08               ` Lars Magne Ingebrigtsen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).