We are rewriting DCR/document after replacing some value in XML node,
but if that document has special character it add some Weird Character
for example we have superscript 2(square) it add weird character in front of it
Like below
²
We r also converting document to UTF-8 with following sub
sub convertoUtf{
my $your_data = shift;
my $encoding = 'ISO-8859-1';
if ($encoding ne 'UTF-8'){
my $ustr = Unicode:

tring->new();
if ($encoding eq 'UTF-16'){
$ustr->utf16( $your_data );
}else{
my $map = Unicode::Map->new( $encoding );
if (! $map ){
# Deal with the unsupported encoding somehow;
# you probably want to have a message like this:
# "Unsupported XML encoding: $encoding");
}
$ustr->utf16( $map->to_unicode( $your_data ) );
}
$your_data = $ustr->utf8();
}
return $your_data;
}