From 7cafb0ecfc29e36d317b3031918834de87b12a84 Mon Sep 17 00:00:00 2001 From: Andreas Neiser Date: Wed, 21 May 2014 08:00:41 +0200 Subject: [PATCH] =?utf8?q?Fix=20HTML=20entity=20decoding=20for=20unit,=20e?= =?utf8?q?specially=20=C2=B0C...?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- xml-db/get.pl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/xml-db/get.pl b/xml-db/get.pl index 2f6fdaf..4699eb3 100755 --- a/xml-db/get.pl +++ b/xml-db/get.pl @@ -4,6 +4,7 @@ use Storable qw(lock_store lock_retrieve); use feature "switch"; use Time::HiRes qw( time usleep ); use CGI::Carp qw(fatalsToBrowser); +use HTML::Entities qw(encode_entities); use if (!defined $ENV{'QUERY_STRING'}), warnings; use if (!defined $ENV{'QUERY_STRING'}), Pod::Usage; @@ -253,7 +254,7 @@ sub FormatPretty { } my $range = $obj->{start}+$obj->{bits}-1; $range .= "..".$obj->{start} if ($obj->{bits}>1); - $ret .= " ".$obj->{unit} if exists $obj->{unit}; + $ret .= " ".encode_entities($obj->{unit}) if exists $obj->{unit}; $ret .= sprintf("$name (Bit $range)
raw: 0x%x
$cstr
",$rawvalue); } @@ -278,7 +279,7 @@ sub FormatPretty { } default {$ret = sprintf("0x%08x",$value);} } - $ret .= " ".$obj->{unit} if exists $obj->{unit}; + $ret .= " ".encode_entities($obj->{unit}) if exists $obj->{unit}; } return $ret; } -- 2.43.0