[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[sup-devel] [PATCH 07/10] transcode output from mime-decode hook too
---
lib/sup/message-chunks.rb | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/lib/sup/message-chunks.rb b/lib/sup/message-chunks.rb
index 581b707..6328f1f 100644
--- 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
--
1.6.3.3
_______________________________________________
Sup-devel mailing list
Sup-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-devel