From: Eli Zaretskii Date: Sat, 7 Oct 2006 13:13:34 +0000 (+0000) Subject: (rmail-redecode-body): If the old encoding is `undecided', call X-Git-Tag: emacs-pretest-22.0.90~204 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=4baf35c9a6447dc93b3e359c2a6dc02115dd2490;p=emacs.git (rmail-redecode-body): If the old encoding is `undecided', call find-coding-systems-region to find a proper non-trivial encoding. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index afafe3d2204..6093b1c907b 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2006-10-07 Eli Zaretskii + + * 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 * textmodes/reftex-vars.el (defgroup reftex): Update home page diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el index 473175e142b..b196d906f81 100644 --- a/lisp/mail/rmail.el +++ b/lisp/mail/rmail.el @@ -2875,6 +2875,12 @@ iso-8859, koi8-r, etc." (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)