Archive of RubyForge sup-talk mailing list
 help / color / mirror / Atom feed
From: dato@net.com.org.es (Adeodato Simó)
Subject: [sup-talk] [PATCH] mime-decode hook: provide a "charset" variable with the attachment charset
Date: Fri, 10 Jul 2009 17:00:29 +0200	[thread overview]
Message-ID: <6fc2e5dd8aa2b0b8547375d77b1776d779f85817.1247238014.git.dato@net.com.org.es> (raw)

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? <dato at net.com.org.es>
---
 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



             reply	other threads:[~2009-07-10 15:00 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-10 15:00 Adeodato Simó [this message]
2009-07-23  9:35 ` Adeodato Simó
2009-07-27 16:51   ` William Morgan
2009-07-30 15:56     ` Adeodato Simó
2009-07-30 15:57       ` [sup-talk] [PATCH] HookContext::method_missing(): allow locals to be nil Adeodato Simó
2009-08-19 21:22       ` [sup-talk] [PATCH] mime-decode hook: provide a "charset" variable with the attachment charset Adeodato Simó
2009-08-22 18:15         ` William Morgan
2009-08-22 19:16           ` Adeodato Simó
2009-08-23 17:34             ` William Morgan
2009-09-13 23:17               ` Adeodato Simó
2009-09-26 18:12                 ` William Morgan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6fc2e5dd8aa2b0b8547375d77b1776d779f85817.1247238014.git.dato@net.com.org.es \
    --to=dato@net.com.org.es \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox