diff options
| author | Lars Ingebrigtsen | 2016-02-12 15:48:49 +1100 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2016-02-12 15:48:49 +1100 |
| commit | 4a3ea2323bb6eebb425c22f0a5de2c544cc1999b (patch) | |
| tree | 3bd41fa71e772c487587dc953150565001cb7c53 | |
| parent | 4f8de080ef9bd6417fa99560f8bf9f3e7cc4d28b (diff) | |
| download | emacs-4a3ea2323bb6eebb425c22f0a5de2c544cc1999b.tar.gz emacs-4a3ea2323bb6eebb425c22f0a5de2c544cc1999b.zip | |
Don't use mm-with-unibyte-buffer in utf7
* lisp/gnus/utf7.el (utf7-fragment-encode): Don't use
mm-with-unibyte-buffer.
| -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) |