Synch with Oort Gnus.
authoryamaoka <yamaoka>
Fri, 25 Jan 2002 02:53:09 +0000 (02:53 +0000)
committeryamaoka <yamaoka>
Fri, 25 Jan 2002 02:53:09 +0000 (02:53 +0000)
lisp/ChangeLog
lisp/lpath.el
lisp/mm-view.el

index 9d3c475..e41a933 100644 (file)
@@ -1,10 +1,18 @@
+2002-01-25  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+       * lpath.el: Fbind `w3m-charset-to-coding-system'; bind
+       `w3m-meta-content-type-charset-regexp'.
+
+       * mm-view.el (mm-inline-text-html-render-with-w3m): Decode
+       charset-encoded html contents.
+
 2002-01-24  ShengHuo ZHU  <zsh@cs.rochester.edu>
 
        * gnus-agent.el (gnus-agent-request-article): Make sure it is not
        empty file.
 
        * nnweb.el (url): Ignore errors when request url.
-       
+
        * nnrss.el: Clean up the comments.
 
 2002-01-24  Katsumi Yamaoka  <yamaoka@jpl.org>
index d53a322..42622d0 100644 (file)
@@ -40,7 +40,7 @@
               url-view-url vcard-pretty-print
               url-insert-file-contents
               w3-coding-system-for-mime-charset w3-prepare-buffer w3-region
-              w3m-region
+              w3m-charset-to-coding-system w3m-region
               widget-make-intangible x-defined-colors))
 
 (maybe-bind '(adaptive-fill-first-line-regexp
@@ -58,7 +58,7 @@
              rmail-enable-mime-composing
              rmail-insert-mime-forwarded-message-function
              w3-meta-content-type-charset-regexp
-             w3m-mode-map))
+             w3m-meta-content-type-charset-regexp w3m-mode-map))
 
 (if (featurep 'xemacs)
     (progn
index 26f68a0..ac94e4a 100644 (file)
 (defun mm-inline-text-html-render-with-w3m (handle)
   (mm-setup-w3m)
   (let ((text (mm-get-part handle))
-       (b (point)))
+       (b (point))
+       (charset (mail-content-type-get (mm-handle-type handle) 'charset)))
     (save-excursion
       (insert text)
       (save-restriction
        (narrow-to-region b (point))
        (goto-char (point-min))
+       (when (re-search-forward w3m-meta-content-type-charset-regexp nil t)
+         (setq charset (or (w3m-charset-to-coding-system (match-string 2))
+                           charset)))
+       (when charset
+         (delete-region (point-min) (point-max))
+         (insert (mm-decode-string text charset)))
        (w3m-region (point-min) (point-max))
        (setq mm-w3m-minor-mode t))
       (mm-handle-set-undisplayer