]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/blobdiff - lib/rbot/core/utils/utils.rb
utils: support hex HTML entities
[user/henk/code/ruby/rbot.git] / lib / rbot / core / utils / utils.rb
index e3392f1fafadad95c38d113d1b1bc540c6585f7e..7b316ffe28cd3df6ffc6ecd0d1707063142dd1bb 100644 (file)
@@ -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