changeset 89228:0d3de0f3bef6

(quoted-printable-encode-region): Fix non-Emacs 22 case.
author Dave Love <fx@gnu.org>
date Wed, 16 Oct 2002 16:24:19 +0000
parents 101ee928c088
children 44095c046162
files lisp/gnus/qp.el
diffstat 1 files changed, 9 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/gnus/qp.el	Wed Oct 16 09:12:55 2002 +0000
+++ b/lisp/gnus/qp.el	Wed Oct 16 16:24:19 2002 +0000
@@ -35,7 +35,10 @@
 (defun quoted-printable-decode-region (from to &optional coding-system)
   "Decode quoted-printable in the region between FROM and TO, per RFC 2045.
 If CODING-SYSTEM is non-nil, decode bytes into characters with that
-coding-system."
+coding-system.
+
+Interactively, you can supply the CODING-SYSTEM argument
+with \\[universal-coding-system-argument]."
   (interactive
    ;; Let the user determine the coding system with "C-x RET c".
    (list (region-beginning) (region-end) coding-system-for-read))
@@ -95,13 +98,12 @@
   (save-excursion
     (goto-char from)
     (if (fboundp 'string-to-multibyte)	; Emacs 22
-	;; Fixme: Should we allow codes in the range \x80-\xff?
 	(if (re-search-forward (string-to-multibyte "[^\x0-\x7f\x80-\xff]")
 			       to t)
-	    ;; Fixme: Improve message.
-	    (error "Multibyte character in QP encoding region")
-	  (if (re-search-forward "[^\x0-\xff]" to t)
-	      (error "Multibyte character in QP encoding region")))))
+	    ;; Fixme: This is somewhat misleading.
+	    (error "Multibyte character in QP encoding region"))
+      (if (re-search-forward (mm-string-as-multibyte "[^\0-\377]") to t)
+	  (error "Multibyte character in QP encoding region"))))
   (unless class
     ;; Avoid using 8bit characters. = is \075.
     ;; Equivalent to "^\000-\007\013\015-\037\200-\377="
@@ -115,7 +117,7 @@
 		  (not (eobp)))
 	(insert
 	 (prog1
-	     ;; To unibyte in case of eight-bit-{control,graphics}
+	     ;; To unibyte in case of Emacs 22 eight-bit.
 	     (format "=%02X" (multibyte-char-to-unibyte (char-after)))
 	   (delete-char 1))))
       ;; Encode white space at the end of lines.