2001-07-13 08:00:00 ShengHuo ZHU <zsh@cs.rochester.edu>
[gnus] / lisp / mm-view.el
index 2adeb8f..7d46ca9 100644 (file)
                  (condition-case var
                      (w3-region (point-min) (point-max))
                    (error
+                     (delete-region (point-min) (point-max))
+                     (let ((b (point))
+                           (charset (mail-content-type-get
+                                     (mm-handle-type handle) 'charset)))
+                       (if (or (eq charset 'gnus-decoded)
+                               (eq mail-parse-charset 'gnus-decoded))
+                           (save-restriction
+                             (narrow-to-region (point) (point))
+                             (mm-insert-part handle)
+                             (goto-char (point-max)))
+                         (insert (mm-decode-string (mm-get-part handle) 
+                                                   charset))))
                     (message
                      "Error while rendering html; showing as text/plain"))))))
            (mm-handle-set-undisplayer