Archive of RubyForge sup-devel mailing list
 help / color / mirror / Atom feed
* [sup-devel] [PATCH] force binary encoding before parsing decrypted messages
@ 2010-01-02 16:42 Rich Lane
  2010-01-03 15:16 ` William Morgan
  0 siblings, 1 reply; 2+ messages in thread
From: Rich Lane @ 2010-01-02 16:42 UTC (permalink / raw)
  To: sup-devel

---
 lib/sup/crypto.rb |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/lib/sup/crypto.rb b/lib/sup/crypto.rb
index fb2661a..91652c7 100644
--- a/lib/sup/crypto.rb
+++ b/lib/sup/crypto.rb
@@ -130,6 +130,7 @@ class CryptoManager
     end
 
     output = IO.read output_fn.path
+    output.force_encoding Encoding::ASCII_8BIT if output.respond_to? :force_encoding
 
     ## there's probably a better way to do this, but we're using the output to
     ## look for a valid signature being present.
@@ -157,6 +158,7 @@ class CryptoManager
     msg = RMail::Parser.read output
     if msg.header.content_type =~ %r{^multipart/} && !msg.multipart?
       output = "MIME-Version: 1.0\n" + output
+      output.force_encoding Encoding::ASCII_8BIT if output.respond_to? :force_encoding
       msg = RMail::Parser.read output
     end
     notice = Chunk::CryptoNotice.new :valid, "This message has been decrypted for display"
-- 
1.6.3.3

_______________________________________________
Sup-devel mailing list
Sup-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-devel


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [sup-devel] [PATCH] force binary encoding before parsing decrypted messages
  2010-01-02 16:42 [sup-devel] [PATCH] force binary encoding before parsing decrypted messages Rich Lane
@ 2010-01-03 15:16 ` William Morgan
  0 siblings, 0 replies; 2+ messages in thread
From: William Morgan @ 2010-01-03 15:16 UTC (permalink / raw)
  To: sup-devel

Applied to the ruby-1.9-encoding branch, remerged into next. Thanks!
-- 
William <wmorgan-sup@masanjin.net>
_______________________________________________
Sup-devel mailing list
Sup-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-devel


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-01-03 15:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-01-02 16:42 [sup-devel] [PATCH] force binary encoding before parsing decrypted messages Rich Lane
2010-01-03 15:16 ` William Morgan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox