mail-utils.el: multibyte chars should be quoted.

This commit is contained in:
Richard M. Stallman 2012-03-10 04:02:06 -05:00
parent de3bc99a8d
commit 607e855510
2 changed files with 8 additions and 2 deletions

View file

@ -1,5 +1,7 @@
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.

View file

@ -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"