]> git.eshelyaron.com Git - emacs.git/commitdiff
(quoted-printable-encode-region): Fix non-multibyte search
authorDave Love <fx@gnu.org>
Wed, 9 Oct 2002 22:51:01 +0000 (22:51 +0000)
committerDave Love <fx@gnu.org>
Wed, 9 Oct 2002 22:51:01 +0000 (22:51 +0000)
for Emacs 22.

lisp/gnus/qp.el

index 136dbd0c9cb175c99da642e62c432ad3509fe2d8..6ceeb259ae18cd78106e7c5dfd49dfb3d94eb0d0 100644 (file)
@@ -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 @@ encode lines starting with \"From\"."
   (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="