From: Katsumi Yamaoka Date: Fri, 6 Aug 2010 03:43:29 +0000 (+0000) Subject: (rfc2047-encode): Use utf-8 charset as a last resort. X-Git-Tag: emacs-pretest-24.0.90~104^2~275^2~438^2~49^2~51 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=cbfb9427737c02f3238e8e131dd062dd6bca796f;p=emacs.git (rfc2047-encode): Use utf-8 charset as a last resort. --- diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 4c364c3270d..fb4f6e64d02 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -1,3 +1,8 @@ +2010-08-06 Katsumi Yamaoka + + * rfc2047.el (rfc2047-encode): Use utf-8 as a last resort if + determining charset of text fails. + 2010-08-01 Katsumi Yamaoka * nnmail.el (nnmail-get-new-mail-1): Revert. diff --git a/lisp/gnus/rfc2047.el b/lisp/gnus/rfc2047.el index 840b02a26fd..27d34ee5290 100644 --- a/lisp/gnus/rfc2047.el +++ b/lisp/gnus/rfc2047.el @@ -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)))