From: wmorgan Date: Sun, 9 Dec 2007 20:02:17 +0000 (+0000) Subject: iconv/rfc2047 patch from ismo puustinen (slightly modified) X-Git-Url: https://git.cworth.org/git?a=commitdiff_plain;h=1b7320cc20aac405ab13cb097b65d96b06419d2a;p=sup iconv/rfc2047 patch from ismo puustinen (slightly modified) git-svn-id: svn://rubyforge.org/var/svn/sup/trunk@753 5c8cc53c-5e98-4d25-b20a-d8db53a31250 --- diff --git a/lib/sup/rfc2047.rb b/lib/sup/rfc2047.rb index ab006a0..10ad7e0 100644 --- a/lib/sup/rfc2047.rb +++ b/lib/sup/rfc2047.rb @@ -55,7 +55,11 @@ module Rfc2047 # Convert: # # Remember - Iconv.open(to, from)! - text = Iconv.iconv(target, charset, text).join + begin + text = Iconv.iconv(target + "//IGNORE", charset, text + " ").join[0 .. -2] + rescue Iconv::InvalidCharacter + text + end end end end