commit 951dcef74d4778d72a411fc217b9ae7aa0390439
parent 7bc3cc39e260a8bd800b58358bf3f413642bdcbf
Author: Rich Lane <rlane@club.cc.cmu.edu>
Date: Thu, 31 Dec 2009 15:36:55 -0800
transcode output from mime-decode hook too
Diffstat:
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lib/sup/message-chunks.rb b/lib/sup/message-chunks.rb
@@ -99,7 +99,7 @@ EOS
text = case @content_type
when /^text\/plain\b/
- Iconv.easy_decode $encoding, encoded_content.charset || $encoding, @raw_content
+ @raw_content
else
HookManager.run "mime-decode", :content_type => content_type,
:filename => lambda { write_to_disk },
@@ -109,6 +109,7 @@ EOS
@lines = nil
if text
+ text = text.transcode(encoded_content.charset || $encoding)
@lines = text.gsub("\r\n", "\n").gsub(/\t/, " ").gsub(/\r/, "").split("\n")
@lines = lines.map {|l| l.chomp.wrap WRAP_LEN}.flatten
@quotable = true