| Class | UnicodePlugin |
| In: |
lib/rbot/core/unicode.rb
|
| Parent: | CoreBotModule |
# File lib/rbot/core/unicode.rb, line 67
67: def initialize(*a)
68: super
69: @@old_kcode = $KCODE
70: self.class.reconfigure_filter(@bot)
71: end
# File lib/rbot/core/unicode.rb, line 80
80: def UnicodePlugin.reconfigure_filter(bot)
81: debug "configuring encodings"
82: enable = bot.config['encoding.enable']
83: if not enable
84: bot.socket.filter = nil
85: $KCODE = @@old_kcode
86: return
87: end
88: charsets = bot.config['encoding.charsets']
89: charsets = ['utf-8'] if charsets.empty?
90: bot.socket.filter = UnicodeFilter.new(charsets[0], *charsets)
91: $KCODE = 'u'
92: end