Gnus development mailing list
 help / color / mirror / Atom feed
* decode text/* parts before displaying them
@ 2004-10-07 14:41 TSUCHIYA Masatoshi
  0 siblings, 0 replies; only message in thread
From: TSUCHIYA Masatoshi @ 2004-10-07 14:41 UTC (permalink / raw)


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

Hi,

The following attached part is not displayed with current Gnus.


[-- Attachment #2: eucjp.tex --]
[-- Type: text/x-tex, Size: 122 bytes --]

\documentclass{jarticle}
\begin{document}
Can you read these characters?
\end{document}

[-- Attachment #3: Type: text/plain, Size: 552 bytes --]


In order to avoid this problem, I have just installed the following
change:

    2004-10-07  TSUCHIYA Masatoshi  <tsuchiya@namazu.org>

        * gnus-art.el (gnus-mime-display-single): Call `mm-display-inline'
        instead of calling `mm-insert-inline', to decode text/* parts
        before displaying them.

I, however, worry whether this change is appropriate or not, because
there are several choices to fix this problem.  The first choice is my
proposal.  The second choice is to call `mm-inline-text' instead of
calling `mm-insert-inline'.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #4: Type: text/x-patch, Size: 360 bytes --]

--- gnus-art.el	6 Oct 2004 07:48:57 -0000	7.55
+++ gnus-art.el	7 Oct 2004 14:05:35 -0000
@@ -4709,7 +4709,7 @@
 	      (forward-line -1)
 	      (setq beg (point)))
 	    (gnus-article-insert-newline)
-	    (mm-insert-inline handle (mm-get-part handle))
+	    (mm-inline-text handle)
 	    (goto-char (point-max))))
 	  ;; Do highlighting.
 	  (save-excursion

[-- Attachment #5: Type: text/plain, Size: 81 bytes --]


The last choice is to decode a part content before calling
`mm-insert-inline'.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #6: Type: text/x-patch, Size: 602 bytes --]

--- gnus-art.el	6 Oct 2004 07:48:57 -0000	7.55
+++ gnus-art.el	7 Oct 2004 14:07:34 -0000
@@ -4709,7 +4709,14 @@
 	      (forward-line -1)
 	      (setq beg (point)))
 	    (gnus-article-insert-newline)
-	    (mm-insert-inline handle (mm-get-part handle))
+	    (mm-insert-inline handle
+			      (let ((charset
+				     (mail-content-type-get
+				      (mm-handle-type handle) 'charset)))
+				(if (eq charset 'gnus-decoded)
+				    (mm-get-part handle)
+				  (mm-decode-string (mm-get-part handle)
+						    charset))))
 	    (goto-char (point-max))))
 	  ;; Do highlighting.
 	  (save-excursion

[-- Attachment #7: Type: text/plain, Size: 65 bytes --]


Could you tell me which choice is best?

-- 
TSUCHIYA Masatoshi

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-10-07 14:41 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-10-07 14:41 decode text/* parts before displaying them TSUCHIYA Masatoshi

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