+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
(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)))
(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)