[sup-talk] Sup crash report, part 2

Ismo Puustinen ismo at iki.fi
Tue Dec 4 04:48:19 EST 2007


Hi again,

I found after some experimenting that the following patch appears to 
fix the problem (not sure about the results, but at least sup no 
longer crashes): 

Index: lib/sup/rfc2047.rb
===================================================================
--- lib/sup/rfc2047.rb	(revision 737)
+++ lib/sup/rfc2047.rb	(working copy)
@@ -55,7 +55,16 @@
       # Convert:
       #
       # Remember - Iconv.open(to, from)!
-      text = Iconv.iconv(target, charset, text).join
+      #
+      # Note that because of the iconv bug descrcibed in
+      # http://po-ru.com/diary/fixing-invalid-utf-8-in-ruby-revisited/
+      # we need to still use the rescue block (or work around the issue
+      # in another way).
+      begin
+          text = Iconv.iconv(target + "//IGNORE", charset, text).join
+      rescue Iconv::InvalidCharacter
+          text
+      end
     end
   end
 end


The next problem will be getting utf-8 support for the curses 
interface, since the messages don't currently display correctly... 

-- 
Ismo Puustinen <ismo at iki.fi>


More information about the sup-talk mailing list