From: Richard M. Stallman Date: Sat, 10 Mar 2012 09:02:06 +0000 (-0500) Subject: mail-utils.el: multibyte chars should be quoted. X-Git-Tag: emacs-pretest-24.0.05~117 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=607e855510987c88d2197f2a52fff8a635a24776;p=emacs.git mail-utils.el: multibyte chars should be quoted. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 0648c9dc5cd..1d225b9cd81 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,7 @@ 2012-03-10 Richard Stallman + * mail/mail-utils.el (mail-quote-printable): Quote multibyte chars. + * mail/rmail.el (rmail-buffers-swapped-p): Don't assume dead view buffer means not swapped. (rmail-view-buffer-kill-buffer-hook): Give buf name in error msg. diff --git a/lisp/mail/mail-utils.el b/lisp/mail/mail-utils.el index a20201fb529..9059da817b6 100644 --- a/lisp/mail/mail-utils.el +++ b/lisp/mail/mail-utils.el @@ -63,12 +63,16 @@ from START (inclusive) to END (exclusive)." ;;;###autoload (defun mail-quote-printable (string &optional wrapper) - "Convert a string to the \"quoted printable\" Q encoding. + "Convert a string to the \"quoted printable\" Q encoding if necessary. +If the string contains only ASCII characters and no troublesome ones, +we return it unconverted. + If the optional argument WRAPPER is non-nil, we add the wrapper characters =?ISO-8859-1?Q?....?=." (let ((i 0) (result "")) (save-match-data - (while (string-match "[?=\"\200-\377]" string i) + (while (or (string-match "[?=\"]" string i) + (string-match "[^\000-\177]" string i)) (setq result (concat result (substring string i (match-beginning 0)) (upcase (format "=%02x"