From mboxrd@z Thu Jan 1 00:00:00 1970 From: dato@net.com.org.es (=?utf-8?q?Adeodato=20Sim=C3=B3?=) Date: Fri, 10 Jul 2009 17:00:29 +0200 Subject: [sup-talk] [PATCH] mime-decode hook: provide a "charset" variable with the attachment charset Message-ID: <6fc2e5dd8aa2b0b8547375d77b1776d779f85817.1247238014.git.dato@net.com.org.es> This is useful, for example, for HTML attachments which are sent in a charset different from the default for the system (eg., ISO-8859-1 on an UTF-8 system), so that the converter program can be told what charset it should be converting from. Signed-off-by: Adeodato Sim? --- lib/sup/message-chunks.rb | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/lib/sup/message-chunks.rb b/lib/sup/message-chunks.rb index 0d742d9..ea04ed7 100644 --- a/lib/sup/message-chunks.rb +++ b/lib/sup/message-chunks.rb @@ -50,7 +50,8 @@ directly in Sup. For attachments that you wish to use a separate program to view (e.g. images), you should use the mime-view hook instead. Variables: - content_type: the content-type of the message + content_type: the content-type of the attachment + charset: the charset of the attachment, if applicable filename: the filename of the attachment as saved to disk sibling_types: if this attachment is part of a multipart MIME attachment, an array of content-types for all attachments. Otherwise, @@ -103,6 +104,7 @@ EOS else HookManager.run "mime-decode", :content_type => content_type, :filename => lambda { write_to_disk }, + :charset => encoded_content.charset, :sibling_types => sibling_types end -- 1.6.3.3