(mml-generate-mime-1): Encode parts other than text/* or message/* containing
authorKatsumi Yamaoka <yamaoka@jpl.org>
Thu, 2 Mar 2006 07:08:27 +0000 (07:08 +0000)
committerKatsumi Yamaoka <yamaoka@jpl.org>
Thu, 2 Mar 2006 07:08:27 +0000 (07:08 +0000)
 non-ASCII text properly.

lisp/ChangeLog
lisp/mml.el

index 07aa435..ffa76a6 100644 (file)
@@ -1,3 +1,8 @@
+2006-03-02  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+       * mml.el (mml-generate-mime-1): Encode parts other than text/* or
+       message/* containing non-ASCII text properly.
+
 2006-03-01  Reiner Steib  <Reiner.Steib@gmx.de>
 
        * message.el: Require gmm-utils, remove autoloads.
index 274eca3..23def1b 100644 (file)
@@ -518,7 +518,15 @@ If MML is non-nil, return the buffer up till the correspondent mml tag."
                                 (mm-find-buffer-file-coding-system
                                  filename)))))
               (t
-               (insert (cdr (assq 'contents cont)))))
+               (let ((contents (cdr (assq 'contents cont))))
+                 (if (if (featurep 'xemacs)
+                         (string-match "[^\000-\377]" contents)
+                       (mm-multibyte-string-p contents))
+                     (progn
+                       (mm-enable-multibyte)
+                       (insert contents)
+                       (setq charset (mm-encode-body charset)))
+                   (insert contents)))))
              (setq encoding (mm-encode-buffer type)
                    coded (mm-string-as-multibyte (buffer-string))))
            (mml-insert-mime-headers cont type charset encoding nil)