]> git.cworth.org Git - sup/blobdiff - lib/sup/rfc2047.rb
add hooks for before- and after- yaml marshalling
[sup] / lib / sup / rfc2047.rb
index 947de022bc41715c641585e7fe73b4405aac7b6e..f31faa1f9b6fb9483ba9f24ac1eb3f6fd9f369b9 100644 (file)
@@ -52,16 +52,7 @@ module Rfc2047
         # WORD.
       end
 
-      charset = "utf-8" if charset =~ /UTF_?8/i
-
-      # Convert:
-      #
-      # Remember - Iconv.open(to, from)!
-      begin
-        text = Iconv.iconv(target + "//IGNORE", charset, text + " ").join[0 .. -2]
-      rescue Iconv::InvalidCharacter
-        text
-      end
+      Iconv.easy_decode(target, charset, text)
     end
   end
 end