Subject: Re: [sup-devel] [issue132] strange encoding error

From: Gaute Hope <[email-masked]>
Date: Tue, 22 Mar 2011 01:11:16 +0100

Excerpts from anonymous's message of 2010-11-23 11:36:48 +0100:
> 
> New submission from anonymous:
> 
> this happens when i try to send an email...
> 
> ----------------------------------------------------------------
> --- Encoding::CompatibilityError from thread: main
> incompatible character encodings: UTF-8 and ASCII-8BIT
> /usr/lib/ruby/gems/1.9.1/gems/rmail-1.0.0/lib/rmail/serialize.rb:112:in
> `serialize_low'
> /usr/lib/ruby/gems/1.9.1/gems/rmail-1.0.0/lib/rmail/serialize.rb:99:in `block in

Hi,

ran into the same problem today; this seems to be a problem with rmail.
Apply this patch to the installed gem:

diff -ru rmail-1.0.0/lib/rmail/serialize.rb rmail-1.0.0-new//lib/rmail/serialize.rb
--- rmail-1.0.0/lib/rmail/serialize.rb	2011-03-22 01:08:07.413333337 +0100
+++ rmail-1.0.0-new//lib/rmail/serialize.rb	2011-03-22 01:07:45.183333337 +0100
@@ -109,6 +109,7 @@
         @output << message.header.to_s
         unless message.body.nil?
           @output << "\n"
+          message.body.force_encoding 'UTF-8'
           @output << message.body
           if depth == 0 and message.body.length > 0 and
               message.body[-1] != ?\n
 
Best regards,
Gaute Hope

---

From: anonymous <[email-masked]>
Date: Tue, 23 Nov 2010 10:36:48 +0000

----------------------------------------------------------------
--- Encoding::CompatibilityError from thread: main
incompatible character encodings: UTF-8 and ASCII-8BIT
/usr/lib/ruby/gems/1.9.1/gems/rmail-1.0.0/lib/rmail/serialize.rb:112:in
`serialize_low'
/usr/lib/ruby/gems/1.9.1/gems/rmail-1.0.0/lib/rmail/serialize.rb:99:in `block in
serialize_low'
/usr/lib/ruby/gems/1.9.1/gems/rmail-1.0.0/lib/rmail/message.rb:155:in `block in
each_part'
/usr/lib/ruby/gems/1.9.1/gems/rmail-1.0.0/lib/rmail/message.rb:154:in `each'
/usr/lib/ruby/gems/1.9.1/gems/rmail-1.0.0/lib/rmail/message.rb:154:in `each_part'
/usr/lib/ruby/gems/1.9.1/gems/rmail-1.0.0/lib/rmail/serialize.rb:96:in
`serialize_low'
/usr/lib/ruby/gems/1.9.1/gems/rmail-1.0.0/lib/rmail/serialize.rb:63:in `serialize'
/usr/lib/ruby/gems/1.9.1/gems/rmail-1.0.0/lib/rmail/message.rb:146:in `to_s'
/usr/lib/ruby/gems/1.9.1/gems/sup-0.11/lib/sup/modes/edit-message-mode.rb:344:in
`puts'
/usr/lib/ruby/gems/1.9.1/gems/sup-0.11/lib/sup/modes/edit-message-mode.rb:344:in
`block in send_message'
/usr/lib/ruby/gems/1.9.1/gems/sup-0.11/lib/sup/modes/edit-message-mode.rb:344:in
`popen'
/usr/lib/ruby/gems/1.9.1/gems/sup-0.11/lib/sup/modes/edit-message-mode.rb:344:in
`send_message'
/usr/lib/ruby/gems/1.9.1/gems/sup-0.11/lib/sup/mode.rb:59:in `handle_input'
/usr/lib/ruby/gems/1.9.1/gems/sup-0.11/lib/sup/buffer.rb:279:in `handle_input'
/usr/lib/ruby/gems/1.9.1/gems/sup-0.11/bin/sup:279:in `<module:Redwood>'
/usr/lib/ruby/gems/1.9.1/gems/sup-0.11/bin/sup:68:in `<top (required)>'
/usr/bin/sup:19:in `load'
/usr/bin/sup:19:in `<main>'

----------
messages: 311
nosy: anonymous
priority: bug
ruby_version: 1.9.1
status: unread
sup_version: 0.11
title: strange encoding error

_________________________________________
Sup issue tracker <[email-masked]>
<http://masanjin.net/sup-bugs/issue132>
_________________________________________
_______________________________________________
Sup-devel mailing list
[email-masked]
http://rubyforge.org/mailman/listinfo/sup-devel