From bf9734ff89a238c5a63015b68eabd8d0ef9d1308 Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Mon, 14 May 2012 13:59:20 +0200 Subject: utils: support hex HTML entities --- lib/rbot/core/utils/utils.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib') 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 -- cgit v1.2.3