]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/commitdiff
[httputil] fix to ignore recoding errors
authorMatthias H <apoc@sixserv.org>
Fri, 28 Feb 2014 21:53:16 +0000 (22:53 +0100)
committerMatthias H <apoc@sixserv.org>
Fri, 28 Feb 2014 21:53:16 +0000 (22:53 +0100)
lib/rbot/core/utils/httputil.rb

index 1b4c35269a1f44c89707f8b47a82330544aa37fe..aba730f9087e68c790c9b48c93accf56689a47a6 100644 (file)
@@ -72,7 +72,7 @@ module ::Net
         begin
           debug "try decoding using #{charset}"
           str.force_encoding(charset)
-          tmp = str.encode(Encoding::UTF_8)
+          tmp = str.encode('UTF-16le', :invalid => :replace, :replace => '').encode('UTF-8')
           if tmp
             str = tmp
             break