- (mm-url-insert url))
-
-;; Because xml-parse-region can't deal with anything that isn't
-;; xml and w3-parse-buffer can't deal with some xml, we have to
-;; parse with xml-parse-region first and, if that fails, parse
-;; with w3-parse-buffer. Yuck. Eventually, someone should find out
-;; why w3-parse-buffer fails to parse some well-formed xml and
-;; fix it.
-
- (condition-case err
- (setq xmlform (xml-parse-region (point-min) (point-max)))
- (error (if (fboundp 'w3-parse-buffer)
- (setq htmlform (caddar (w3-parse-buffer
- (current-buffer))))
- (message "nnrss: Not valid XML and w3 parse not available (%s)"
- url))))
- (if htmlform
- htmlform
- xmlform))))
+ (let (;; FIXME: shouldn't binding `coding-system-for-read' be
+ ;; moved to `mm-url-insert'?
+ (coding-system-for-read 'binary)
+ ;; mm-url will load mm-util. d-e-m-c should be bound to
+ ;; t then, because of `mm-emacs-mule'.
+ (default-enable-multibyte-characters t))
+ (mm-url-insert url)))
+ (nnheader-remove-cr-followed-by-lf)
+ ;; Decode text according to the encoding attribute.
+ (when (setq cs (nnrss-get-encoding))
+ (mm-decode-coding-region (point-min) (point-max) cs)
+ (mm-enable-multibyte))
+ (goto-char (point-min))
+
+ ;; Because xml-parse-region can't deal with anything that isn't
+ ;; xml and w3-parse-buffer can't deal with some xml, we have to
+ ;; parse with xml-parse-region first and, if that fails, parse
+ ;; with w3-parse-buffer. Yuck. Eventually, someone should find out
+ ;; why w3-parse-buffer fails to parse some well-formed xml and
+ ;; fix it.
+
+ (condition-case err1
+ (setq xmlform (xml-parse-region (point-min) (point-max)))
+ (error
+ (condition-case err2
+ (setq htmlform (caddar (w3-parse-buffer
+ (current-buffer))))
+ (error
+ (message "\
+nnrss: %s: Not valid XML %s and w3-parse doesn't work %s"
+ url err1 err2)))))
+ (if htmlform
+ htmlform
+ xmlform))))