emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 41de25c: Make mm-shr use mail-parse-charset by defa


From: Katsumi Yamaoka
Subject: [Emacs-diffs] master 41de25c: Make mm-shr use mail-parse-charset by default
Date: Wed, 8 Feb 2017 19:41:46 -0500 (EST)

branch: master
commit 41de25c1134e201235ac7f6e19ecb2925a7df635
Author: Katsumi Yamaoka <address@hidden>
Commit: Katsumi Yamaoka <address@hidden>

    Make mm-shr use mail-parse-charset by default
    
    * lisp/gnus/mm-decode.el (mm-shr): Use mail-parse-charset by default.
    This helps an html message with no charset spec to be decoded.
---
 lisp/gnus/mm-decode.el | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/lisp/gnus/mm-decode.el b/lisp/gnus/mm-decode.el
index 579222f..989d4b8 100644
--- a/lisp/gnus/mm-decode.el
+++ b/lisp/gnus/mm-decode.el
@@ -1793,22 +1793,23 @@ If RECURSIVE, search recursively."
                                      (buffer-string))))))
        (shr-inhibit-images mm-html-inhibit-images)
        (shr-blocked-images mm-html-blocked-images)
-       charset char)
+       charset coding char)
     (unless handle
       (setq handle (mm-dissect-buffer t)))
-    (setq charset (mail-content-type-get (mm-handle-type handle) 'charset))
+    (and (setq charset
+              (or (mail-content-type-get (mm-handle-type handle) 'charset)
+                  mail-parse-charset))
+        (setq coding (mm-charset-to-coding-system charset nil t))
+        (eq coding 'ascii)
+        (setq coding nil))
     (save-restriction
       (narrow-to-region (point) (point))
       (shr-insert-document
        (mm-with-part handle
         (insert (prog1
-                    (if (and charset
-                             (setq charset
-                                   (mm-charset-to-coding-system charset
-                                                                nil t))
-                             (not (eq charset 'ascii)))
-                        (decode-coding-string (buffer-string) charset)
-                      (string-as-multibyte (buffer-string)))
+                    (if coding
+                        (decode-coding-string (buffer-string) coding)
+                      (buffer-string))
                   (erase-buffer)
                   (mm-enable-multibyte)))
         (goto-char (point-min))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]