summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/mail/rmailmm.el12
2 files changed, 16 insertions, 1 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 59edd984774..e79f8563b49 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
+2014-09-13 Eli Zaretskii <eliz@gnu.org>
+
+ * mail/rmailmm.el (rmail-mime-insert-html): Decode the HTML part
+ using the specified transfer-encoding, if any, or 'undecided'.
+
2013-12-27 Ken Olum <kdo@cosmos.phy.tufts.edu>
Support rendering of HTML parts in Rmail (bug#4258).
diff --git a/lisp/mail/rmailmm.el b/lisp/mail/rmailmm.el
index f28089762e6..becfb2f8cab 100644
--- a/lisp/mail/rmailmm.el
+++ b/lisp/mail/rmailmm.el
@@ -659,7 +659,12 @@ HEADER is a header component of a MIME-entity object (see
"Decode, render, and insert html from MIME-entity ENTITY."
(let ((body (rmail-mime-entity-body entity))
(transfer-encoding (rmail-mime-entity-transfer-encoding entity))
- (buffer (current-buffer)))
+ (charset (cdr (assq 'charset (cdr (rmail-mime-entity-type entity)))))
+ (buffer (current-buffer))
+ coding-system)
+ (if charset (setq coding-system (coding-system-from-name charset)))
+ (or (and coding-system (coding-system-p coding-system))
+ (setq coding-system 'undecided))
(with-temp-buffer
(set-buffer-multibyte nil)
(setq buffer-undo-list t)
@@ -669,6 +674,11 @@ HEADER is a header component of a MIME-entity object (see
(ignore-errors (base64-decode-region (point-min) (point-max))))
((string= transfer-encoding "quoted-printable")
(quoted-printable-decode-region (point-min) (point-max))))
+ (decode-coding-region (point-min) (point) coding-system)
+ (if (and
+ (or (not rmail-mime-coding-system) (consp rmail-mime-coding-system))
+ (not (eq (coding-system-base coding-system) 'us-ascii)))
+ (setq rmail-mime-coding-system coding-system))
;; Convert html in temporary buffer to text and insert in original buffer
(let ((source-buffer (current-buffer)))
(with-current-buffer buffer