Mercurial > emacs
changeset 104835:88f046f0db6f
(utf7-encode, utf7-decode): Use mm-with-multibyte-buffer, or
mm-with-unibyte-buffer, rather than default-enable-multibyte-characters.
author | Glenn Morris <rgm@gnu.org> |
---|---|
date | Fri, 04 Sep 2009 02:46:08 +0000 |
parents | 36201c0e0c98 |
children | 629a32caa79e |
files | lisp/gnus/utf7.el |
diffstat | 1 files changed, 11 insertions(+), 13 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/gnus/utf7.el Fri Sep 04 02:45:43 2009 +0000 +++ b/lisp/gnus/utf7.el Fri Sep 04 02:46:08 2009 +0000 @@ -1,7 +1,7 @@ ;;; utf7.el --- UTF-7 encoding/decoding for Emacs -*-coding: iso-8859-1;-*- -;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, -;; 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. +;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, +;; 2008, 2009 Free Software Foundation, Inc. ;; Author: Jon K Hellan <hellan@acm.org> ;; Maintainer: bugs@gnus.org @@ -210,23 +210,21 @@ (if (and (coding-system-p 'utf-7) (coding-system-p 'utf-7-imap)) ;; Emacs 23 with proper support for IMAP (encode-coding-string string (if for-imap 'utf-7-imap 'utf-7)) - (let ((default-enable-multibyte-characters t)) - (with-temp-buffer - (insert string) - (utf7-encode-internal for-imap) - (buffer-string))))) + (mm-with-multibyte-buffer + (insert string) + (utf7-encode-internal for-imap) + (buffer-string)))) (defun utf7-decode (string &optional for-imap) "Decode UTF-7 STRING. Use IMAP modification if FOR-IMAP is non-nil." (if (and (coding-system-p 'utf-7) (coding-system-p 'utf-7-imap)) ;; Emacs 23 with proper support for IMAP (decode-coding-string string (if for-imap 'utf-7-imap 'utf-7)) - (let ((default-enable-multibyte-characters nil)) - (with-temp-buffer - (insert string) - (utf7-decode-internal for-imap) - (mm-enable-multibyte) - (buffer-string))))) + (mm-with-unibyte-buffer + (insert string) + (utf7-decode-internal for-imap) + (mm-enable-multibyte) + (buffer-string)))) (provide 'utf7)