]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/commitdiff
[unicode] fix to ignore invalid-unicode
authorMatthias H <apoc@sixserv.org>
Fri, 21 Feb 2014 19:36:43 +0000 (20:36 +0100)
committerMatthias H <apoc@sixserv.org>
Fri, 21 Feb 2014 19:36:43 +0000 (20:36 +0100)
lib/rbot/core/unicode.rb

index b6471472a89ec9fc5861feabe15d56070c717e5d..02638bbd3141235e6909012fb56191d9d545bdd1 100644 (file)
@@ -22,6 +22,7 @@ class UnicodePlugin < CoreBotModule
 
     def in(data)
       data.force_encoding @charset if data
+      data.encode('UTF-16le', :invalid => :replace, :replace => '').encode('UTF-8')
     end
 
     def out(data)