1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-21 06:55:39 +00:00

Fix Rmail base64 and qp decoding of MIME payloads

* lisp/mail/rmailmm.el (rmail-mime-insert-decoded-text)
(rmail-mime-insert-html): Remove ^M characters left from DOS EOLs.
This is what 'rmail-decode-region' does for non-MIME messages.
This commit is contained in:
Eli Zaretskii 2024-09-02 17:14:29 +03:00
parent 0def396fa8
commit 7799ef4335

View File

@ -579,7 +579,11 @@ HEADER is a header component of a MIME-entity object (see
(ignore-errors (base64-decode-region pos (point))))
((string= transfer-encoding "quoted-printable")
(quoted-printable-decode-region pos (point))))))
(decode-coding-region pos (point) coding-system)
(decode-coding-region
pos (point)
;; Use -dos decoding, to remove ^M characters left from base64 or
;; rogue qp-encoded text.
(coding-system-change-eol-conversion coding-system 1))
(if (and
(or (not rmail-mime-coding-system) (consp rmail-mime-coding-system))
(not (eq (coding-system-base coding-system) 'us-ascii)))
@ -691,7 +695,11 @@ HEADER is a header component of a MIME-entity object (see
(if (and (eq coding-system 'undecided)
(not (null coding-system-for-read)))
(setq coding-system coding-system-for-read))))
(decode-coding-region (point-min) (point) coding-system)
(decode-coding-region
(point-min) (point)
;; Use -dos decoding, to remove ^M characters left from base64 or
;; rogue qp-encoded text.
(coding-system-change-eol-conversion coding-system 1))
(if (and
(or (not rmail-mime-coding-system) (consp rmail-mime-coding-system))
(not (eq (coding-system-base coding-system) 'us-ascii)))