find-coding-systems-region to find a proper non-trivial encoding.
+2006-10-07 Eli Zaretskii <eliz@gnu.org>
+
+ * mail/rmail.el (rmail-redecode-body): If the old encoding is
+ `undecided', call find-coding-systems-region to find a proper
+ non-trivial encoding.
+
2006-10-07 Kevin Ryde <user42@zip.com.au>
* textmodes/reftex-vars.el (defgroup reftex): Update home page
(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)