Samy_rio has asked for the wisdom of the Perl Monks concerning the following question:
Greeting monks, I have one problem while using XML::Twig and my tried code as:
use strict; use XML::Twig; my $file = $ARGV[0]; my $first = 'paragraph'; my $replace = 'p'; my $twig = XML::Twig->new(twig_handlers => {"$first" => sub {$_->set_gi("$replace")}}, ); $twig->parsefile($file); $twig->print;
It works fine, But it convert all hexadecimal entities with some symbols. I need same text as input.
Input: <paragraph>Société Nationale des Chemins de Fer Fran� +0E7;ais, the Spain (Telefónica)</paragraph> Current Output: <p>Société Nationale des Chemins de Fer Français, the Spain (Telefà +³nica)</p> Expected Output: <p>Société Nationale des Chemins de Fer Français, + the Spain (Telefónica)</p>
How to avoid this?
Regards,
Velusamy R.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Hexadecimal Entity Problem in XML::Twig
by Skeeve (Parson) on Oct 27, 2005 at 14:21 UTC | |
|
Re: Hexadecimal Entity Problem in XML::Twig
by mirod (Canon) on Oct 27, 2005 at 14:54 UTC | |
|
Re: Hexadecimal Entity Problem in XML::Twig
by graff (Chancellor) on Oct 28, 2005 at 01:05 UTC |