From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/19050 Path: main.gmane.org!not-for-mail From: Shenghuo ZHU Newsgroups: gmane.emacs.gnus.general Subject: Re: bug in displaying a message in russian (\214<8-bit-char>) Date: 22 Nov 1998 05:39:52 -0500 Organization: Computer Dept of U Rochester Sender: owner-ding@hpc.uh.edu Message-ID: <2n67c8ui2v.fsf@zsh.cs.rochester.edu> References: NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: main.gmane.org 1035157471 9587 80.91.224.250 (20 Oct 2002 23:44:31 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 20 Oct 2002 23:44:31 +0000 (UTC) Return-Path: Original-Received: from karazm.math.uh.edu (karazm.math.uh.edu [129.7.128.1]) by sclp3.sclp.com (8.8.5/8.8.5) with ESMTP id FAA01690 for ; Sun, 22 Nov 1998 05:41:37 -0500 (EST) Original-Received: from sina.hpc.uh.edu (lists@Sina.HPC.UH.EDU [129.7.3.5]) by karazm.math.uh.edu (8.9.1/8.9.1) with ESMTP id EAB07154; Sun, 22 Nov 1998 04:41:26 -0600 (CST) Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Sun, 22 Nov 1998 04:41:22 -0600 (CST) Original-Received: from sclp3.sclp.com (root@sclp3.sclp.com [204.252.123.139]) by sina.hpc.uh.edu (8.7.3/8.7.3) with ESMTP id EAA25126 for ; Sun, 22 Nov 1998 04:41:08 -0600 (CST) Original-Received: from cayuga.cs.rochester.edu (cayuga.cs.rochester.edu [192.5.53.209]) by sclp3.sclp.com (8.8.5/8.8.5) with SMTP id FAA01682 for ; Sun, 22 Nov 1998 05:41:01 -0500 (EST) Original-Received: from slate.cs.rochester.edu (slate.cs.rochester.edu [192.5.53.101]) by cayuga.cs.rochester.edu (8.6.9/O) with ESMTP id FAA24482 for ; Sun, 22 Nov 1998 05:41:00 -0500 Original-Received: from brain.cs.rochester.edu (heart.cs.rochester.edu [192.5.53.109]) by slate.cs.rochester.edu (8.6.9/O) with ESMTP id FAA17624 for ; Sun, 22 Nov 1998 05:40:56 -0500 Original-Received: (from zsh@localhost) by brain.cs.rochester.edu (8.9.0/8.8.5) id FAA03300; Sun, 22 Nov 1998 05:39:53 -0500 Original-To: ding@gnus.org X-Attribution: ZSH X-Face: 'IF:e51ib'Qbl^(}l^&4-J`'P!@[4~O|&k#:@Gld#b/]oMq&`&FVY._3+b`mzp~Jeve~/#/ ERD!OTe<86UhyN=l`mrPY)M7_}`Ktt\K+58Z!hu7>qU,i.N7TotU[FYE(f1;}`g2xj!u*l`^&=Q!g{ *q|ddto|nkt"$r,K$[)"|6,elPH= GJ6Q In-Reply-To: Vladimir Volovich's message of "22 Nov 1998 11:31:46 +0300" Original-Lines: 137 User-Agent: Gnus/5.070053 (Pterodactyl Gnus v0.53) Emacs/20.3 Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:19050 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:19050 This is a MIME multipart message. If you are reading this, you shouldn't. --=-=-= Vladimir Volovich writes: > i attached a message which is displayed broken by gnus. it is an > 8-bit koi8-r message without C-T header, so you should set (setq > mm-default-coding-system 'koi8). It contains a uuencoded file > inside. Maybe, this causes double decoding, too? Yup. A patch is attached. -- Shenghuo --=-=-= --- ChangeLog 1998/11/22 09:41:03 1.1 +++ ChangeLog 1998/11/22 10:21:47 @@ -1,3 +1,9 @@ +Sun Nov 22 04:42:22 1998 Shenghuo ZHU + + * mm-uu.el (mm-uu-test): New function. + (mm-uu-dissect): Inherit charset and cte from head. + * gnus-art.el (article-decode-charset): Use mm-uu-test. + Sat Nov 21 09:57:01 1998 Lars Magne Ingebrigtsen * gnus.el: Pterodactyl Gnus v0.53 is released. --- gnus-art.el 1998/11/22 09:44:18 1.1 +++ gnus-art.el 1998/11/22 10:19:26 @@ -1049,8 +1049,9 @@ (widen) (forward-line 1) (narrow-to-region (point) (point-max)) - (when (or (not ctl) - (equal (car ctl) "text/plain")) + (when (and (or (not ctl) + (equal (car ctl) "text/plain")) + (not (mm-uu-test))) (mm-decode-body charset (and cte (intern (downcase (gnus-strip-whitespace cte)))) --- mm-uu.el 1998/11/22 09:34:53 1.1 +++ mm-uu.el 1998/11/22 10:21:05 @@ -72,13 +72,27 @@ (defun mm-uu-dissect () "Dissect the current buffer and return a list of uu handles." - (save-excursion - (save-restriction - (mail-narrow-to-head) - (goto-char (point-max))) - (forward-line) - (let ((text-start (point)) start-char end-char - type file-name end-line result) + (let (ct ctl cte charset text-start start-char end-char + type file-name end-line result text-plain-type) + (save-excursion + (save-restriction + (mail-narrow-to-head) + (when (and (mail-fetch-field "mime-version") + (setq ct (mail-fetch-field "content-type"))) + (setq cte (message-fetch-field "content-transfer-encoding" t) + ctl (condition-case () (mail-header-parse-content-type ct) + (error nil)) + charset (and ctl (mail-content-type-get ctl 'charset))) + (if (stringp cte) + (setq cte (intern (downcase (mail-header-remove-whitespace + (mail-header-remove-comments + cte))))))) + (goto-char (point-max))) + (forward-line) + (setq text-start (point) + text-plain-type (cons "text/plain" + (if charset + (list (cons 'charset charset))))) (while (re-search-forward mm-uu-begin-line nil t) (beginning-of-line) (setq start-char (point)) @@ -93,7 +107,7 @@ (nnheader-translate-file-chars (match-string 1)))))) (setq end-line (symbol-value (intern (concat "mm-uu-" (symbol-name type) - "-end-line")))) + "-end-line")))) (when (re-search-forward end-line nil t) (forward-line) (setq end-char (point)) @@ -105,7 +119,7 @@ (if (> start-char text-start) (push (list (mm-uu-copy-to-buffer text-start start-char) - '("text/plain") nil nil nil nil) + text-plain-type cte nil nil nil) result)) (push (cond @@ -143,9 +157,29 @@ (if (> (point-max) (1+ text-start)) (push (list (mm-uu-copy-to-buffer text-start (point-max)) - '("text/plain") nil nil nil nil) + text-plain-type cte nil nil nil) result)) (setq result (cons "multipart/mixed" (nreverse result)))) + result))) + +;;;### autoload +(defun mm-uu-test () + "Check whether the current buffer contains uu stuffs." + (save-excursion + (save-restriction + (mail-narrow-to-head) + (goto-char (point-max))) + (forward-line) + (let (type end-line result) + (while (and (not result) (re-search-forward mm-uu-begin-line nil t)) + (forward-line) + (setq type (cdr (assq (aref (match-string 0) 0) + mm-uu-identifier-alist))) + (setq end-line (symbol-value + (intern (concat "mm-uu-" (symbol-name type) + "-end-line")))) + (if (re-search-forward end-line nil t) + (setq result t))) result))) (provide 'mm-uu) --=-=-=--