# HG changeset patch # User Katsumi Yamaoka # Date 1220941420 0 # Node ID 335a46d662d16a582b0a04486734d9e718f0029a # Parent 3867a846db659129192cdbff7017f81daad23d6c * gnus-art.el (gnus-mime-strip-charset-parameters): Remove. (gnus-mime-set-charset-parameters): New function. (gnus-mime-view-part-as-charset): Use it to correctly display part specifying wrong charset. diff -r 3867a846db65 -r 335a46d662d1 lisp/gnus/ChangeLog --- a/lisp/gnus/ChangeLog Tue Sep 09 02:29:02 2008 +0000 +++ b/lisp/gnus/ChangeLog Tue Sep 09 06:23:40 2008 +0000 @@ -1,3 +1,10 @@ +2008-09-09 Katsumi Yamaoka + + * gnus-art.el (gnus-mime-strip-charset-parameters): Remove. + (gnus-mime-set-charset-parameters): New function. + (gnus-mime-view-part-as-charset): Use it to correctly display part + specifying wrong charset. + 2008-09-08 David Engster * nnmairix.el (nnmairix-create-server-and-default-group): Require match diff -r 3867a846db65 -r 335a46d662d1 lisp/gnus/gnus-art.el --- a/lisp/gnus/gnus-art.el Tue Sep 09 02:29:02 2008 +0000 +++ b/lisp/gnus/gnus-art.el Tue Sep 09 06:23:40 2008 +0000 @@ -5138,8 +5138,9 @@ (mm-string-to-multibyte contents))) (goto-char b))))) -(defun gnus-mime-strip-charset-parameters (handle) - "Strip charset parameters from HANDLE." +(defun gnus-mime-set-charset-parameters (handle) + "Set charset to parameters in HANDLE. +The value of `gnus-newsgroup-charset' is used as a charset." (if (stringp (car handle)) (mapc #'gnus-mime-strip-charset-parameters (cdr handle)) (let* ((type (mm-handle-type (if (equal (mm-handle-media-type handle) @@ -5150,8 +5151,10 @@ (mm-handle-cache handle)) handle))) (charset (assq 'charset (cdr type)))) - (when charset - (delq charset type))))) + (if charset + (setcdr charset (symbol-name gnus-newsgroup-charset)) + (setcdr type (cons (cons 'charset (symbol-name gnus-newsgroup-charset)) + (cdr type))))))) (defun gnus-mime-view-part-as-charset (&optional handle arg) "Insert the MIME part under point into the current buffer using the @@ -5172,7 +5175,7 @@ (mm-read-coding-system "Charset: ")))) (if (mm-handle-undisplayer handle) (mm-remove-part handle))) - (gnus-mime-strip-charset-parameters handle) + (gnus-mime-set-charset-parameters handle) (when (and (consp (setq form (cdr-safe fun))) (setq form (ignore-errors (assq 'gnus-mime-display-alternative form)))