From 4a3ea2323bb6eebb425c22f0a5de2c544cc1999b Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Fri, 12 Feb 2016 15:48:49 +1100 Subject: [PATCH] Don't use mm-with-unibyte-buffer in utf7 * lisp/gnus/utf7.el (utf7-fragment-encode): Don't use mm-with-unibyte-buffer. --- lisp/gnus/utf7.el | 17 +++++++++++------ 1 file 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." "Encode text from START to END in buffer as UTF-7 escape fragment. Use IMAP modification if FOR-IMAP is non-nil." (save-restriction - (narrow-to-region start end) - (funcall (utf7-get-u16char-converter 'to-utf-16)) - (mm-with-unibyte-current-buffer - (base64-encode-region start (point-max))) - (goto-char start) + (let* ((buf (current-buffer)) + (base (with-temp-buffer + (set-buffer-multibyte nil) + (insert-buffer-substring buf start end) + (funcall (utf7-get-u16char-converter 'to-utf-16)) + (base64-encode-region (point-min) (point-max)) + (buffer-string)))) + (narrow-to-region start end) + (delete-region (point-min) (point-max)) + (insert base)) + (goto-char (point-min)) (let ((pm (point-max))) (when for-imap (while (search-forward "/" nil t) @@ -186,7 +192,6 @@ Use IMAP modification if FOR-IMAP is non-nil." "Convert latin 1 (ISO-8859.1) characters to 16 bit Unicode. Characters are converted to raw byte pairs in narrowed buffer." (encode-coding-region (point-min) (point-max) 'iso-8859-1) - (mm-disable-multibyte) (goto-char (point-min)) (while (not (eobp)) (insert 0) -- 2.39.2