aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKatsumi Yamaoka2010-10-05 02:08:37 +0000
committerKatsumi Yamaoka2010-10-05 02:08:37 +0000
commitcfadea45dbc6168e97f464956b8fc5c84103ecb3 (patch)
tree11ab2d86f0eb5523d3a9afacd57558697fa10344
parent97ab3539e0676ef78c2bced0f0c9ce48439fa2ee (diff)
downloademacs-cfadea45dbc6168e97f464956b8fc5c84103ecb3.tar.gz
emacs-cfadea45dbc6168e97f464956b8fc5c84103ecb3.zip
mm-decode.el (mm-shr): Decode contents by charset.
-rw-r--r--lisp/gnus/ChangeLog4
-rw-r--r--lisp/gnus/mm-decode.el15
2 files changed, 18 insertions, 1 deletions
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index a2371a51b48..96e0cc20f9e 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,7 @@
12010-10-05 Katsumi Yamaoka <yamaoka@jpl.org>
2
3 * mm-decode.el (mm-shr): Decode contents by charset.
4
12010-10-04 Lars Magne Ingebrigtsen <larsi@gnus.org> 52010-10-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
2 6
3 * shr.el (shr-tag-blockquote): Ensure paragraph after quote, too. 7 * shr.el (shr-tag-blockquote): Ensure paragraph after quote, too.
diff --git a/lisp/gnus/mm-decode.el b/lisp/gnus/mm-decode.el
index ab96e349bb6..edbd252c3c8 100644
--- a/lisp/gnus/mm-decode.el
+++ b/lisp/gnus/mm-decode.el
@@ -1679,14 +1679,27 @@ If RECURSIVE, search recursively."
1679 (and (eq (mm-body-7-or-8) '7bit) 1679 (and (eq (mm-body-7-or-8) '7bit)
1680 (not (mm-long-lines-p 76)))))) 1680 (not (mm-long-lines-p 76))))))
1681 1681
1682(declare-function libxml-parse-html-region "xml.c"
1683 (start end &optional base-url))
1684(declare-function shr-insert-document "shr" (dom))
1685
1682(defun mm-shr (handle) 1686(defun mm-shr (handle)
1683 (let ((article-buffer (current-buffer))) 1687 (let ((article-buffer (current-buffer))
1688 charset)
1684 (unless handle 1689 (unless handle
1685 (setq handle (mm-dissect-buffer t))) 1690 (setq handle (mm-dissect-buffer t)))
1691 (setq charset (mail-content-type-get (mm-handle-type handle) 'charset))
1686 (save-restriction 1692 (save-restriction
1687 (narrow-to-region (point) (point)) 1693 (narrow-to-region (point) (point))
1688 (shr-insert-document 1694 (shr-insert-document
1689 (mm-with-part handle 1695 (mm-with-part handle
1696 (when (and charset
1697 (setq charset (mm-charset-to-coding-system charset))
1698 (not (eq charset 'ascii)))
1699 (insert (prog1
1700 (mm-decode-coding-string (buffer-string) charset)
1701 (erase-buffer)
1702 (mm-enable-multibyte))))
1690 (libxml-parse-html-region (point-min) (point-max))))))) 1703 (libxml-parse-html-region (point-min) (point-max)))))))
1691 1704
1692(provide 'mm-decode) 1705(provide 'mm-decode)