summaryrefslogtreecommitdiff
path: root/lisp/gnus/utf7.el
diff options
context:
space:
mode:
authorLars Ingebrigtsen <larsi@gnus.org>2016-02-12 15:48:49 +1100
committerLars Ingebrigtsen <larsi@gnus.org>2016-02-12 15:48:49 +1100
commit4a3ea2323bb6eebb425c22f0a5de2c544cc1999b (patch)
tree3bd41fa71e772c487587dc953150565001cb7c53 /lisp/gnus/utf7.el
parent4f8de080ef9bd6417fa99560f8bf9f3e7cc4d28b (diff)
downloademacs-4a3ea2323bb6eebb425c22f0a5de2c544cc1999b.tar.gz
Don't use mm-with-unibyte-buffer in utf7
* lisp/gnus/utf7.el (utf7-fragment-encode): Don't use mm-with-unibyte-buffer.
Diffstat (limited to 'lisp/gnus/utf7.el')
-rw-r--r--lisp/gnus/utf7.el17
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."
"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)