From fd73f164176d637239714ed7a362a3d4d6fde4fc Mon Sep 17 00:00:00 2001 From: dmitry kim Date: Fri, 21 Nov 2008 01:24:54 +0300 Subject: * (core/unicode) validate encoding.charsets with Iconv --- lib/rbot/core/unicode.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/rbot') diff --git a/lib/rbot/core/unicode.rb b/lib/rbot/core/unicode.rb index 92294bb3..9d42ec24 100644 --- a/lib/rbot/core/unicode.rb +++ b/lib/rbot/core/unicode.rb @@ -21,6 +21,7 @@ class UnicodePlugin < CoreBotModule Config.register Config::ArrayValue.new( 'encoding.charsets', :default => ['utf-8', 'cp1252', 'iso-8859-15'], :desc => "Ordered list of iconv(3) charsets the bot should try", + :validate_item => Proc.new { |x| !!(Iconv.new('utf-8', x) rescue nil) }, :on_change => Proc.new { |bot, v| reconfigure_filter(bot) }) class UnicodeFilter -- cgit v1.2.3