]> git.cworth.org Git - sup/blobdiff - lib/sup/rfc2047.rb
Merge branch 'master' into next
[sup] / lib / sup / rfc2047.rb
index 947de022bc41715c641585e7fe73b4405aac7b6e..fcd5cf071262565ef0594ac736b5c758d44710d5 100644 (file)
@@ -52,13 +52,8 @@ 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]
+        Iconv.easy_decode(target, charset, text)
       rescue Iconv::InvalidCharacter
         text
       end