(rfc2047-encode): Use utf-8 charset as a last resort.
authorKatsumi Yamaoka <yamaoka@jpl.org>
Fri, 6 Aug 2010 03:41:28 +0000 (03:41 +0000)
committerKatsumi Yamaoka <yamaoka@jpl.org>
Fri, 6 Aug 2010 03:41:28 +0000 (03:41 +0000)
lisp/ChangeLog
lisp/rfc2047.el

index b7e654b..23acefb 100644 (file)
@@ -1,3 +1,8 @@
+2010-08-06  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+       * rfc2047.el (rfc2047-encode): Use utf-8 as a last resort if
+       determining charset of text fails.
+
 2010-08-01  Katsumi Yamaoka  <yamaoka@jpl.org>
 
        * nnmail.el (nnmail-get-new-mail-1): Revert.
index 840b02a..27d34ee 100644 (file)
@@ -655,6 +655,9 @@ should not change this value.")
 Point moves to the end of the region."
   (let ((mime-charset (or (mm-find-mime-charset-region b e) (list 'us-ascii)))
        cs encoding tail crest eword)
+    ;; Use utf-8 as a last resort if determining charset of text fails.
+    (if (memq nil mime-charset)
+       (setq mime-charset (list 'utf-8)))
     (cond ((> (length mime-charset) 1)
           (error "Can't rfc2047-encode `%s'"
                  (buffer-substring-no-properties b e)))