summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authordmitry kim <jason@nichego.net>2008-11-21 01:24:54 +0300
committerdmitry kim <jason@nichego.net>2008-11-21 01:38:47 +0300
commitfd73f164176d637239714ed7a362a3d4d6fde4fc (patch)
treeb65a11ff4e1f113defc3271cb7bd49150817995b /lib
parent11092542ded9d33f2f5abd3f5c8789ff73bb37b4 (diff)
* (core/unicode) validate encoding.charsets with Iconv
Diffstat (limited to 'lib')
-rw-r--r--lib/rbot/core/unicode.rb1
1 files changed, 1 insertions, 0 deletions
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