changeset 110086:f661002e9a6d

gnus-article-html: Decode contents by charset.
author Katsumi Yamaoka <yamaoka@jpl.org>
date Wed, 01 Sep 2010 06:04:49 +0000
parents fc3e98cf87b7
children b84898221ef1
files lisp/gnus/ChangeLog lisp/gnus/gnus-html.el
diffstat 2 files changed, 11 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/gnus/ChangeLog	Wed Sep 01 04:48:51 2010 +0000
+++ b/lisp/gnus/ChangeLog	Wed Sep 01 06:04:49 2010 +0000
@@ -1,3 +1,7 @@
+2010-09-01  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+	* gnus-html.el (gnus-article-html): Decode contents by charset.
+
 2010-09-01  Katsumi Yamaoka  <yamaoka@jpl.org>
 
 	* gnus-html.el (gnus-html-cache-directory, gnus-html-cache-size)
--- a/lisp/gnus/gnus-html.el	Wed Sep 01 04:48:51 2010 +0000
+++ b/lisp/gnus/gnus-html.el	Wed Sep 01 06:04:49 2010 +0000
@@ -66,7 +66,13 @@
 	  (let* ((coding-system-for-read 'utf-8)
 		 (coding-system-for-write 'utf-8)
 		 (default-process-coding-system
-		   (cons coding-system-for-read coding-system-for-write)))
+		   (cons coding-system-for-read coding-system-for-write))
+		 (charset (mail-content-type-get (mm-handle-type handle)
+						 'charset)))
+	    (when (and charset
+		       (setq charset (mm-charset-to-coding-system charset))
+		       (not (eq charset 'ascii)))
+	      (mm-decode-coding-region (point-min) (point-max) charset))
 	    (call-process-region (point-min) (point-max)
 				 "w3m" 
 				 nil article-buffer nil