diff options
| author | Richard M. Stallman | 2012-03-10 04:02:06 -0500 |
|---|---|---|
| committer | Richard M. Stallman | 2012-03-10 04:02:06 -0500 |
| commit | 607e855510987c88d2197f2a52fff8a635a24776 (patch) | |
| tree | d91476ca9c27dd15b90eec4400d9df90c53da349 | |
| parent | de3bc99a8d21d742e0fea36094274b3ed85bcf11 (diff) | |
| download | emacs-607e855510987c88d2197f2a52fff8a635a24776.tar.gz emacs-607e855510987c88d2197f2a52fff8a635a24776.zip | |
mail-utils.el: multibyte chars should be quoted.
| -rw-r--r-- | lisp/ChangeLog | 2 | ||||
| -rw-r--r-- | lisp/mail/mail-utils.el | 8 |
2 files changed, 8 insertions, 2 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 0648c9dc5cd..1d225b9cd81 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,7 @@ | |||
| 1 | 2012-03-10 Richard Stallman <rms@gnu.org> | 1 | 2012-03-10 Richard Stallman <rms@gnu.org> |
| 2 | 2 | ||
| 3 | * mail/mail-utils.el (mail-quote-printable): Quote multibyte chars. | ||
| 4 | |||
| 3 | * mail/rmail.el (rmail-buffers-swapped-p): Don't assume dead | 5 | * mail/rmail.el (rmail-buffers-swapped-p): Don't assume dead |
| 4 | view buffer means not swapped. | 6 | view buffer means not swapped. |
| 5 | (rmail-view-buffer-kill-buffer-hook): Give buf name in error msg. | 7 | (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)." | |||
| 63 | 63 | ||
| 64 | ;;;###autoload | 64 | ;;;###autoload |
| 65 | (defun mail-quote-printable (string &optional wrapper) | 65 | (defun mail-quote-printable (string &optional wrapper) |
| 66 | "Convert a string to the \"quoted printable\" Q encoding. | 66 | "Convert a string to the \"quoted printable\" Q encoding if necessary. |
| 67 | If the string contains only ASCII characters and no troublesome ones, | ||
| 68 | we return it unconverted. | ||
| 69 | |||
| 67 | If the optional argument WRAPPER is non-nil, | 70 | If the optional argument WRAPPER is non-nil, |
| 68 | we add the wrapper characters =?ISO-8859-1?Q?....?=." | 71 | we add the wrapper characters =?ISO-8859-1?Q?....?=." |
| 69 | (let ((i 0) (result "")) | 72 | (let ((i 0) (result "")) |
| 70 | (save-match-data | 73 | (save-match-data |
| 71 | (while (string-match "[?=\"\200-\377]" string i) | 74 | (while (or (string-match "[?=\"]" string i) |
| 75 | (string-match "[^\000-\177]" string i)) | ||
| 72 | (setq result | 76 | (setq result |
| 73 | (concat result (substring string i (match-beginning 0)) | 77 | (concat result (substring string i (match-beginning 0)) |
| 74 | (upcase (format "=%02x" | 78 | (upcase (format "=%02x" |