sub de_er{
my($er)=@_;
my($output_char,$atr,$value);
+ my($prefix,$suffix);
+ $er=~/^(amp|&)?(.+?)(;)?$/
+ and $prefix=$1,$er=$2,$suffix=$3;
+ $prefix or $prefix="",$suffix or $suffix="";
if($er=~/^\d+$/){
- # only for debug.
$output_char=pack("U",$er);
}elsif($er=~/^U[\+\-]([a-fA-F\d]+)/){
$output_char=pack("U",hex($1));
($output_char)=&get_chars_matching($er_alias{$atr},$value);
}
if($output_char){
- return $output_char;
+ return $output_char;
}else{
- return $er;
+ return $prefix.$er.$suffix;
}
}