diff options
Diffstat (limited to 'lisp/gnus/qp.el')
-rw-r--r-- | lisp/gnus/qp.el | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/lisp/gnus/qp.el b/lisp/gnus/qp.el index febf827ef4..6a27b20eb1 100644 --- a/lisp/gnus/qp.el +++ b/lisp/gnus/qp.el @@ -1,6 +1,6 @@ ;;; qp.el --- Quoted-Printable functions -;; Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. +;; Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. ;; Author: Lars Magne Ingebrigtsen <[email protected]> ;; Keywords: mail, extensions @@ -32,13 +32,18 @@ (require 'mm-util) (eval-when-compile (defvar mm-use-ultra-safe-encoding)) +;;;###autoload (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. Interactively, you can supply the CODING-SYSTEM argument -with \\[universal-coding-system-argument]." +with \\[universal-coding-system-argument]. + +The CODING-SYSTEM argument is a historical hangover and is deprecated. +QP encodes raw bytes and should be decoded into raw bytes. Decoding +them into characters should be done separately." (interactive ;; Let the user determine the coding system with "C-x RET c". (list (region-beginning) (region-end) coding-system-for-read)) @@ -67,19 +72,19 @@ with \\[universal-coding-system-argument]." (+ 3 (point))) 16))) (mm-insert-byte byte 1) - (delete-char 3) - (unless (eq byte ?=) - (backward-char)))) + (delete-char 3))) (t - (error "Malformed quoted-printable text") + (message "Malformed quoted-printable text") (forward-char))))) (if coding-system (mm-decode-coding-region (point-min) (point-max) coding-system))))) (defun quoted-printable-decode-string (string &optional coding-system) "Decode the quoted-printable encoded STRING and return the result. -If CODING-SYSTEM is non-nil, decode the region with coding-system." - (with-temp-buffer +If CODING-SYSTEM is non-nil, decode the region with coding-system. +Use of CODING-SYSTEM is deprecated; this function should deal with +raw bytes, and coding conversion should be done separately." + (mm-with-unibyte-buffer (insert string) (quoted-printable-decode-region (point-min) (point-max) coding-system) (buffer-string))) |