2012-03-10 Richard Stallman <rms@gnu.org>
+ * 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.
;;;###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"