Last active
January 2, 2016 22:19
-
-
Save suna-pan/8368900 to your computer and use it in GitHub Desktop.
強いユニコードで攻撃して罪に問われるのを防止するプラグイン
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
Plugin.create(:mikutter_unicode) do | |
filter_gui_postbox_post do |postbox| | |
text = Plugin.create(:gtk).widgetof(postbox).widget_post.buffer.text | |
text = text.unpack('U*').collect! do |i| | |
unless(i == 0xfffd) | |
[i].pack('U') | |
else | |
next | |
end | |
end.join | |
widget = Gtk::PostBox.list.first.widget_post | |
widget.buffer.text = text | |
[postbox] | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment