From: Andreas Neiser Date: Wed, 21 May 2014 06:00:41 +0000 (+0200) Subject: Fix HTML entity decoding for unit, especially °C... X-Git-Url: https://jspc29.x-matter.uni-frankfurt.de/git/?a=commitdiff_plain;h=7cafb0ecfc29e36d317b3031918834de87b12a84;p=daqtools.git Fix HTML entity decoding for unit, especially °C... --- 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; }