2002-01-25 Katsumi Yamaoka <yamaoka@jpl.org>
authorKatsumi Yamaoka <yamaoka@jpl.org>
Fri, 25 Jan 2002 02:36:24 +0000 (02:36 +0000)
committerKatsumi Yamaoka <yamaoka@jpl.org>
Fri, 25 Jan 2002 02:36:24 +0000 (02:36 +0000)
* 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.

lisp/ChangeLog
lisp/lpath.el
lisp/mm-view.el

index 9194fa5..c022021 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 bdcf7a3..484557d 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
@@ -60,7 +60,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 d0f3a78..6258e1d 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