]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/commitdiff
utils: support hex HTML entities
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Mon, 14 May 2012 11:59:20 +0000 (13:59 +0200)
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Mon, 14 May 2012 11:59:20 +0000 (13:59 +0200)
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