# HG changeset patch # User Eli Zaretskii # Date 1160226762 0 # Node ID fb0e9cf9f77be59d96b166bf57766300b594ff42 # Parent ccad7965cd2c423925ed1ee2648c80adb7be4af3 (rmail-redecode-body): If the old encoding is `undecided', call find-coding-systems-region to find a proper non-trivial encoding. diff -r ccad7965cd2c -r fb0e9cf9f77b lisp/mail/rmail.el --- 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)