]> git.eshelyaron.com Git - emacs.git/commitdiff
(rmail-redecode-body): If the old encoding is `undecided', call
authorEli Zaretskii <eliz@gnu.org>
Sat, 7 Oct 2006 13:13:34 +0000 (13:13 +0000)
committerEli Zaretskii <eliz@gnu.org>
Sat, 7 Oct 2006 13:13:34 +0000 (13:13 +0000)
find-coding-systems-region to find a proper non-trivial encoding.

lisp/ChangeLog
lisp/mail/rmail.el

index afafe3d2204f3a6e6a2914289ef284f92d1df057..6093b1c907baf8f3c7ede073f89dad2185e4774e 100644 (file)
@@ -1,3 +1,9 @@
+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
index 473175e142b03db88b2ecbcfd8313178a540c5b5..b196d906f81da9aef9ef4d77210f50c9fb68e536 100644 (file)
@@ -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)