(mml-generate-mime-1): Prefer the MIME charset that Emacs knows since
authorKatsumi Yamaoka <yamaoka@jpl.org>
Mon, 15 Dec 2008 23:35:32 +0000 (23:35 +0000)
committerKatsumi Yamaoka <yamaoka@jpl.org>
Mon, 15 Dec 2008 23:35:32 +0000 (23:35 +0000)
 the charset specified might be a bogus alias that mm-charset-synonym-alist
 provides.

lisp/ChangeLog
lisp/mml.el

index d9deb48..542db0b 100644 (file)
@@ -1,3 +1,9 @@
+2008-12-15  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+       * mml.el (mml-generate-mime-1): Prefer the MIME charset that Emacs
+       knows since the charset specified might be a bogus alias that
+       mm-charset-synonym-alist provides.
+
 2008-12-15  Reiner Steib  <Reiner.Steib@gmx.de>
 
        * mm-util.el (mm-charset-synonym-alist): Add bogus names "UTF8" and
index f8968fb..3e3cb2c 100644 (file)
@@ -482,7 +482,12 @@ If MML is non-nil, return the buffer up till the correspondent mml tag."
                 (setq charset nil
                       coding nil))
                (charset
-                (setq charset (intern (downcase charset)))))
+                ;; The value of `charset' might be a bogus alias that
+                ;; `mm-charset-synonym-alist' provides, like `utf8',
+                ;; so we prefer the MIME charset that Emacs knows for
+                ;; the coding system `coding'.
+                (setq charset (or (mm-coding-system-to-mime-charset coding)
+                                  (intern (downcase charset))))))
          (if (and (not raw)
                   (member (car (split-string type "/")) '("text" "message")))
              (progn