diff lisp/mail/rmail.el @ 73279:fb0e9cf9f77b

(rmail-redecode-body): If the old encoding is `undecided', call find-coding-systems-region to find a proper non-trivial encoding.
author Eli Zaretskii <eliz@gnu.org>
date Sat, 07 Oct 2006 13:12:42 +0000
parents 7d4fe4b4afc9
children f3db6404bec1
line wrap: on
line diff
--- a/lisp/mail/rmail.el	Sat Oct 07 11:13:23 2006 +0000
+++ b/lisp/mail/rmail.el	Sat Oct 07 13:12:42 2006 +0000
@@ -2875,6 +2875,12 @@
 			  (coding-system-change-eol-conversion
 			   coding
 			   (coding-system-eol-type old-coding)))
+		    ;; If old-coding is `undecided', encode-coding-region
+		    ;; will not encode the text at all.  Find a proper
+		    ;; non-trivial encoding to use.
+		    (if (memq (coding-system-base old-coding) '(nil undecided))
+			(setq old-coding
+			      (car (find-coding-systems-region msgbeg msgend))))
 		    (setq x-coding-header (point-marker))
 		    (narrow-to-region msgbeg msgend)
 		    (encode-coding-region (point) msgend old-coding)