changeset 89189:068e199a732e

(quoted-printable-encode-region): Fix non-multibyte search for Emacs 22.
author Dave Love <fx@gnu.org>
date Wed, 09 Oct 2002 22:51:01 +0000
parents f0d0b7118166
children 9693e41cc2fd
files lisp/gnus/qp.el
diffstat 1 files changed, 9 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/gnus/qp.el	Wed Oct 09 22:20:36 2002 +0000
+++ b/lisp/gnus/qp.el	Wed Oct 09 22:51:01 2002 +0000
@@ -1,6 +1,6 @@
 ;;; qp.el --- Quoted-Printable functions
 
-;; Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+;; Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
 ;; Keywords: mail, extensions
@@ -94,9 +94,14 @@
   (interactive "r")
   (save-excursion
     (goto-char from)
-    ;; Fixme: This doesn't get eight-bit characters in multibyte buffers.
-    (if (re-search-forward "[^\x0-\xff]" to t)
-      (error "Multibyte character in QP encoding region")))
+    (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")))))
   (unless class
     ;; Avoid using 8bit characters. = is \075.
     ;; Equivalent to "^\000-\007\013\015-\037\200-\377="