Gnus development mailing list
 help / color / mirror / Atom feed
* Re: bug in displaying a message in russian (\214<8-bit-char>)
       [not found] <m390h4m8lp.fsf_-_@vvv.vsu.ru>
@ 1998-11-22 10:39 ` Shenghuo ZHU
  1998-11-22 11:10   ` Vladimir Volovich
  0 siblings, 1 reply; 2+ messages in thread
From: Shenghuo ZHU @ 1998-11-22 10:39 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 335 bytes --]

Vladimir Volovich <vvv@vvv.vsu.ru> 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


[-- Attachment #2: Type: text/plain, Size: 3682 bytes --]


--- 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  <zsh@cs.rochester.edu>
+
+	* 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  <larsi@menja.ifi.uio.no>
 
 	* 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)

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

* Re: bug in displaying a message in russian (\214<8-bit-char>)
  1998-11-22 10:39 ` bug in displaying a message in russian (\214<8-bit-char>) Shenghuo ZHU
@ 1998-11-22 11:10   ` Vladimir Volovich
  0 siblings, 0 replies; 2+ messages in thread
From: Vladimir Volovich @ 1998-11-22 11:10 UTC (permalink / raw)


"ZSH" == Shenghuo ZHU writes:

 ZSH> Yup. A patch is attached.

Thanks a lot! :-)))

	Best regards, -- Vladimir.
-- 
Your happiness is intertwined with your outlook on life.


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

end of thread, other threads:[~1998-11-22 11:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <m390h4m8lp.fsf_-_@vvv.vsu.ru>
1998-11-22 10:39 ` bug in displaying a message in russian (\214<8-bit-char>) Shenghuo ZHU
1998-11-22 11:10   ` Vladimir Volovich

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).