From: Eli Zaretskii Date: Sat, 28 Feb 2015 12:03:34 +0000 (+0200) Subject: Better decoding of HTML payload in Rmail X-Git-Tag: emacs-25.0.90~2564^2~273 X-Git-Url: https://code.delx.au/gnu-emacs/commitdiff_plain/31ecbf8d513540855aa07588f6746942aed453ba Better decoding of HTML payload in Rmail lisp/mail/rmailmm.el (rmail-mime-insert-html): Decode HTML payload when the charset is only given by the HTML , and allow to specify the encoding with "C-x RET c". --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index b9681d35cf..1cfd08fc95 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2015-02-28 Eli Zaretskii + + * mail/rmailmm.el (rmail-mime-insert-html): Decode HTML payload + when the charset is only given by the HTML , and allow to + specify the encoding with "C-x RET c". + 2015-02-27 Mark Laws Support daemon mode on MS-Windows (bug#19688) diff --git a/lisp/mail/rmailmm.el b/lisp/mail/rmailmm.el index 120d517f55..00fc25dd44 100644 --- a/lisp/mail/rmailmm.el +++ b/lisp/mail/rmailmm.el @@ -661,6 +661,7 @@ HEADER is a header component of a MIME-entity object (see (transfer-encoding (rmail-mime-entity-transfer-encoding entity)) (charset (cdr (assq 'charset (cdr (rmail-mime-entity-type entity))))) (buffer (current-buffer)) + (case-fold-search t) coding-system) (if charset (setq coding-system (coding-system-from-name charset))) (or (and coding-system (coding-system-p coding-system)) @@ -674,6 +675,22 @@ 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)))) + ;; Some broken MUAs state the charset only in the HTML , + ;; so if we don't have a non-trivial coding-system at this + ;; point, make one last attempt to find it there. + (if (eq coding-system 'undecided) + (save-excursion + (goto-char (point-min)) + (when (re-search-forward + "^