Synch to Gnus 200305301042.
authoryamaoka <yamaoka>
Fri, 30 May 2003 11:28:04 +0000 (11:28 +0000)
committeryamaoka <yamaoka>
Fri, 30 May 2003 11:28:04 +0000 (11:28 +0000)
lisp/ChangeLog
lisp/qp.el
lisp/rfc2047.el

index bade54c..dde1285 100644 (file)
@@ -1,3 +1,11 @@
+2003-05-30  Dave Love  <fx@gnu.org>
+
+       * rfc2047.el (rfc2047-decode): Don't use
+       mm-with-unibyte-current-buffer.
+
+       * qp.el (quoted-printable-decode-string): Use
+       mm-with-unibyte-buffer.
+
 2003-05-29  Teodor Zlatanov  <tzz@lifelogs.com>
 
        * gnus-registry.el (gnus-registry-save): allow forced saving even
index 149d30a..b3dfdce 100644 (file)
@@ -81,8 +81,10 @@ them into characters should be done separately."
 
 (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)))
index afa9ebe..cdc918a 100644 (file)
@@ -712,19 +712,16 @@ If your Emacs implementation can't decode CHARSET, return nil."
       (when (and (eq cs 'ascii)
                 mail-parse-charset)
        (setq cs mail-parse-charset))
-      ;; Fixme: What's this for?  The following comment makes no sense. -- fx
-      (mm-with-unibyte-current-buffer
-       ;; In Emacs Mule 4, decoding UTF-8 should be in unibyte mode.
-       (mm-decode-coding-string
-        (cond
-         ((equal "B" encoding)
-          (base64-decode-string
-           (rfc2047-pad-base64 string)))
-         ((equal "Q" encoding)
-          (quoted-printable-decode-string
-           (mm-replace-chars-in-string string ?_ ? )))
-         (t (error "Invalid encoding: %s" encoding)))
-        cs)))))
+      (mm-decode-coding-string
+       (cond
+       ((equal "B" encoding)
+        (base64-decode-string
+         (rfc2047-pad-base64 string)))
+       ((equal "Q" encoding)
+        (quoted-printable-decode-string
+         (mm-replace-chars-in-string string ?_ ? )))
+       (t (error "Invalid encoding: %s" encoding)))
+       cs))))
 
 (provide 'rfc2047)