diff options
author | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2012-05-14 13:59:20 +0200 |
---|---|---|
committer | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2012-05-14 13:59:20 +0200 |
commit | bf9734ff89a238c5a63015b68eabd8d0ef9d1308 (patch) | |
tree | ee6b8ae83675ff53a8bddef56c468c5b5a7707ae | |
parent | 440ef790a60a73e9b47050cddacddba59c61b30b (diff) |
utils: support hex HTML entities
-rw-r--r-- | lib/rbot/core/utils/utils.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/rbot/core/utils/utils.rb b/lib/rbot/core/utils/utils.rb index e3392f1f..7b316ffe 100644 --- a/lib/rbot/core/utils/utils.rb +++ b/lib/rbot/core/utils/utils.rb @@ -355,7 +355,10 @@ module ::Irc return str.gsub(/(&(.+?);)/) { symbol = $2 # remove the 0-paddng from unicode integers - if symbol =~ /^#(\d+)$/ + case symbol + when /^#x([0-9a-fA-F]+)$/ + symbol = $1.to_i(16).to_s + when /^#(\d+)$/ symbol = $1.to_i.to_s end |