diff options
| -rw-r--r-- | lisp/gnus/utf7.el | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/lisp/gnus/utf7.el b/lisp/gnus/utf7.el index 2168b7cf67c..bd04eba2fae 100644 --- a/lisp/gnus/utf7.el +++ b/lisp/gnus/utf7.el | |||
| @@ -119,11 +119,17 @@ Use IMAP modification if FOR-IMAP is non-nil." | |||
| 119 | "Encode text from START to END in buffer as UTF-7 escape fragment. | 119 | "Encode text from START to END in buffer as UTF-7 escape fragment. |
| 120 | Use IMAP modification if FOR-IMAP is non-nil." | 120 | Use IMAP modification if FOR-IMAP is non-nil." |
| 121 | (save-restriction | 121 | (save-restriction |
| 122 | (narrow-to-region start end) | 122 | (let* ((buf (current-buffer)) |
| 123 | (funcall (utf7-get-u16char-converter 'to-utf-16)) | 123 | (base (with-temp-buffer |
| 124 | (mm-with-unibyte-current-buffer | 124 | (set-buffer-multibyte nil) |
| 125 | (base64-encode-region start (point-max))) | 125 | (insert-buffer-substring buf start end) |
| 126 | (goto-char start) | 126 | (funcall (utf7-get-u16char-converter 'to-utf-16)) |
| 127 | (base64-encode-region (point-min) (point-max)) | ||
| 128 | (buffer-string)))) | ||
| 129 | (narrow-to-region start end) | ||
| 130 | (delete-region (point-min) (point-max)) | ||
| 131 | (insert base)) | ||
| 132 | (goto-char (point-min)) | ||
| 127 | (let ((pm (point-max))) | 133 | (let ((pm (point-max))) |
| 128 | (when for-imap | 134 | (when for-imap |
| 129 | (while (search-forward "/" nil t) | 135 | (while (search-forward "/" nil t) |
| @@ -186,7 +192,6 @@ Use IMAP modification if FOR-IMAP is non-nil." | |||
| 186 | "Convert latin 1 (ISO-8859.1) characters to 16 bit Unicode. | 192 | "Convert latin 1 (ISO-8859.1) characters to 16 bit Unicode. |
| 187 | Characters are converted to raw byte pairs in narrowed buffer." | 193 | Characters are converted to raw byte pairs in narrowed buffer." |
| 188 | (encode-coding-region (point-min) (point-max) 'iso-8859-1) | 194 | (encode-coding-region (point-min) (point-max) 'iso-8859-1) |
| 189 | (mm-disable-multibyte) | ||
| 190 | (goto-char (point-min)) | 195 | (goto-char (point-min)) |
| 191 | (while (not (eobp)) | 196 | (while (not (eobp)) |
| 192 | (insert 0) | 197 | (insert 0) |