From: Giuseppe Bilotta Date: Mon, 14 May 2012 11:59:20 +0000 (+0200) Subject: utils: support hex HTML entities X-Git-Url: https://git.netwichtig.de/gitweb/?a=commitdiff_plain;h=bf9734ff89a238c5a63015b68eabd8d0ef9d1308;p=user%2Fhenk%2Fcode%2Fruby%2Frbot.git utils: support hex HTML entities --- 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