Class UnicodePlugin
In: lib/rbot/core/unicode.rb
Parent: CoreBotModule
UnicodePlugin CoreBotModule dot/f_17.png

Methods

Classes and Modules

Class UnicodePlugin::UnicodeFilter

Public Class methods

[Source]

    # 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

[Source]

    # 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

Public Instance methods

[Source]

    # File lib/rbot/core/unicode.rb, line 73
73:     def cleanup
74:         debug "cleaning up encodings"
75:         @bot.socket.filter = nil
76:         $KCODE = @@old_kcode
77:         super
78:     end

[Validate]