+2004-04-19 Eli Zaretskii <eliz@gnu.org>
+
+ * mail/rmail.el (rmail-convert-to-babyl-format): Don't remove ^M
+ characters left after base64 decoding.
+ (rmail-decode-region): Use -dos variety of `coding', to remove any
+ ^M characters left after qp or base64 decoding.
+
2004-04-19 Jan Dj\e,Ad\e(Brv <jan.h.d@swipnet.se>
* x-dnd.el (x-dnd-open-local-file, x-dnd-open-file): Improved error
(defun rmail-decode-region (from to coding)
(if (or (not coding) (not (coding-system-p coding)))
(setq coding 'undecided))
- (decode-coding-region from to coding))
+ ;; Use -dos decoding, to remove ^M characters left from base64 or
+ ;; rogue qp-encoded text.
+ (decode-coding-region from to
+ (coding-system-change-eol-conversion coding 1))
+ ;; Don't reveal the fact we used -dos decoding, as users generally
+ ;; will not expect the RMAIL buffer to use DOS EOL format.
+ (setq buffer-file-coding-system
+ (setq last-coding-system-used
+ (coding-system-change-eol-conversion coding 0))))
;; the rmail-break-forwarded-messages feature is not implemented
(defun rmail-convert-to-babyl-format ()
(error nil))
;; Change "base64" to "8bit", to reflect the
;; decoding we just did.
- (goto-char (1+ header-end))
- (while (search-forward "\r\n" (point-max) t)
- (replace-match "\n"))
(goto-char base64-header-field-end)
(delete-region (point) (search-backward ":"))
(insert ": 8bit"))))
(point)))
t)
(error nil))
- (goto-char header-end)
- (while (search-forward "\r\n" (point-max) t)
- (replace-match "\n"))
;; Change "base64" to "8bit", to reflect the
;; decoding we just did.
(goto-char base64-header-field-end)