From 1b7320cc20aac405ab13cb097b65d96b06419d2a Mon Sep 17 00:00:00 2001 From: wmorgan Date: Sun, 9 Dec 2007 20:02:17 +0000 Subject: [PATCH] iconv/rfc2047 patch from ismo puustinen (slightly modified) git-svn-id: svn://rubyforge.org/var/svn/sup/trunk@753 5c8cc53c-5e98-4d25-b20a-d8db53a31250 --- lib/sup/rfc2047.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 -- 2.45.2