Gnus development mailing list
 help / color / mirror / Atom feed
* 0.58 error in multipart.
@ 1998-12-01  4:51 Lloyd Zusman
  1998-12-01  5:22 ` Shenghuo ZHU
  0 siblings, 1 reply; 3+ messages in thread
From: Lloyd Zusman @ 1998-12-01  4:51 UTC (permalink / raw)


I'm using pgnus-0.58 and XEmacs 20.4.

When trying to decode a multipart article that contains one or more
text/plain parts, I got an error during the text/plain decoding.

Enclosed is a patch that fixes the problem, although I have a feeling
that this just masks a deeper error.  Therefore, I'm posting this
patch to illustrate the problem, not necessarily to suggest a
solution.

It seems that in some (all?) cases of text/plain decoding within a
multipart message, the `mm-decode-string' function returns `nil'.  I
hope that this patch sheds some light on this problem.


 Lloyd Zusman
 ljz@asfast.com


*** mm-view.el.orig     Mon Nov 30 23:14:48 1998
--- mm-view.el  Mon Nov 30 23:40:08 1998
***************
*** 56,65 ****
      (cond
       ((equal type "plain")
        (setq text (mm-get-part handle))
!       (let ((b (point))
!           (charset (mail-content-type-get
!                     (mm-handle-type handle) 'charset)))
!       (insert (mm-decode-string text charset))
        (save-restriction
          (narrow-to-region b (point))
          (mm-handle-set-undisplayer
--- 56,68 ----
      (cond
       ((equal type "plain")
        (setq text (mm-get-part handle))
!       (let* ((b (point))
!            (charset (mail-content-type-get
!                      (mm-handle-type handle) 'charset))
!            (decoded (mm-decode-string text charset)))
!       (insert (if (and decoded (stringp decoded))
!                   decoded
!                 text))
        (save-restriction
          (narrow-to-region b (point))
          (mm-handle-set-undisplayer


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

* Re: 0.58 error in multipart.
  1998-12-01  4:51 0.58 error in multipart Lloyd Zusman
@ 1998-12-01  5:22 ` Shenghuo ZHU
  1998-12-01 15:28   ` Jason L Tibbitts III
  0 siblings, 1 reply; 3+ messages in thread
From: Shenghuo ZHU @ 1998-12-01  5:22 UTC (permalink / raw)


>>>>> "Lloyd" == Lloyd Zusman <ljz@asfast.com> writes:

Lloyd> It seems that in some (all?) cases of text/plain decoding
Lloyd> within a multipart message, the `mm-decode-string' function
Lloyd> returns `nil'.  I hope that this patch sheds some light on this
Lloyd> problem.

Sorry, I make a mistake in mm-decode-string. Fixed.

ChangeLog:

Tue Dec  1 00:15:36 1998  Shenghuo ZHU  <zsh@cs.rochester.edu>

	* mm-bodies.el (mm-decode-string): Return original string if not
	decode.

-- 
Shenghuo

:- cut ---------------------------------
--- mm-bodies.el	1998/12/01 05:14:05	1.1
+++ mm-bodies.el	1998/12/01 05:14:44
@@ -172,14 +172,16 @@
 (defun mm-decode-string (string charset)
   "Decode STRING with CHARSET."
   (setq charset (or charset rfc2047-default-charset))
-  (when (featurep 'mule)
-    (let (mule-charset)
-      (when (and charset
-		 (setq mule-charset (mm-charset-to-coding-system charset))
-		 enable-multibyte-characters
-		 (or (not (eq mule-charset 'ascii))
-		     (setq mule-charset rfc2047-default-charset)))
-	(mm-decode-coding-string string mule-charset)))))
+  (or
+   (when (featurep 'mule)
+     (let (mule-charset)
+       (when (and charset
+		  (setq mule-charset (mm-charset-to-coding-system charset))
+		  enable-multibyte-characters
+		  (or (not (eq mule-charset 'ascii))
+		      (setq mule-charset rfc2047-default-charset)))
+	 (mm-decode-coding-string string mule-charset))))
+   string))
 
 (provide 'mm-bodies)
 


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

* Re: 0.58 error in multipart.
  1998-12-01  5:22 ` Shenghuo ZHU
@ 1998-12-01 15:28   ` Jason L Tibbitts III
  0 siblings, 0 replies; 3+ messages in thread
From: Jason L Tibbitts III @ 1998-12-01 15:28 UTC (permalink / raw)


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

ZSH> Sorry, I make a mistake in mm-decode-string. Fixed.

This fixes things for me.

 - J<


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

end of thread, other threads:[~1998-12-01 15:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-12-01  4:51 0.58 error in multipart Lloyd Zusman
1998-12-01  5:22 ` Shenghuo ZHU
1998-12-01 15:28   ` Jason L Tibbitts III

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