Subject: [sup-talk] Sup crash report, part 2

From: [email-masked] (Ismo Puustinen)
Date: Tue, 4 Dec 2007 11:48:19 +0200

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>

---

From: [email-masked] (William Morgan)
Date: Sun, 09 Dec 2007 12:01:23 -0800

> fix the problem (not sure about the results, but at least sup no

Applied, thanks! I tweaked it to also do the [0 .. -2] trick described.

> interface, since the messages don't currently display correctly... 

See http://rubyforge.org/pipermail/sup-talk/2007-October/000297.html

-- 
William <wmorgan-sup at masanjin.net>