Archive of RubyForge sup-talk mailing list
 help / color / mirror / Atom feed
* [sup-talk] Sup crash report, part 2
@ 2007-12-04  9:48 Ismo Puustinen
  2007-12-09 20:01 ` William Morgan
  0 siblings, 1 reply; 2+ messages in thread
From: Ismo Puustinen @ 2007-12-04  9:48 UTC (permalink / raw)


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>


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

end of thread, other threads:[~2007-12-09 20:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-12-04  9:48 [sup-talk] Sup crash report, part 2 Ismo Puustinen
2007-12-09 20:01 ` William Morgan

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