]> git.cworth.org Git - sup/commitdiff
iconv/rfc2047 patch from ismo puustinen (slightly modified)
authorwmorgan <wmorgan@5c8cc53c-5e98-4d25-b20a-d8db53a31250>
Sun, 9 Dec 2007 20:02:17 +0000 (20:02 +0000)
committerwmorgan <wmorgan@5c8cc53c-5e98-4d25-b20a-d8db53a31250>
Sun, 9 Dec 2007 20:02:17 +0000 (20:02 +0000)
git-svn-id: svn://rubyforge.org/var/svn/sup/trunk@753 5c8cc53c-5e98-4d25-b20a-d8db53a31250

lib/sup/rfc2047.rb

index ab006a09ca1aa9ea25ddb874254cc5bf6b4ea4d6..10ad7e065352ced65a6c19399db635cea9934be2 100644 (file)
@@ -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