]> git.eshelyaron.com Git - emacs.git/commitdiff
(quoted-printable-encode-region): Fix non-Emacs 22 case.
authorDave Love <fx@gnu.org>
Wed, 16 Oct 2002 16:24:19 +0000 (16:24 +0000)
committerDave Love <fx@gnu.org>
Wed, 16 Oct 2002 16:24:19 +0000 (16:24 +0000)
lisp/gnus/qp.el

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