Re: [XML::Simple-2.12] problems parsing non ASCII strings



Michel Rodriguez a émis l'idée suivante :
Jul wrote:

Now, the original caracter is displayed as ISO-8859-15, but coded
with UTF-8. You're right again! lol
At this time, I wonder wether UTF-8 is the default carset or wether there
is an option available for XML::Simple or XML::Parser. I took a look into
those modules documentation but didn't get much.
Otherwise, I'll try to convert data outside XML::Simple.

There is no easy way to get back to the original encoding in XML::Simple. To get the file written back as ISO-8859-15 you can pipe the output through iconv.


<plug mode="shameless">You could also use XML::Twig:
my $options= { ...}; # XML::Simple options
my $twig= XML::Twig->new( keep_encoding => 1)
                    ->parsefile( $file)
                    ->root
                    ->simplify
                    ;

This will do exactly the same thing as XMLin, except for the bit where it keeps the original encoding.
</plug>


Does it help?


Hello Michel,

I've let down ISO-8859-15 for UTF-8.
As the web browser interface tranfers text fields strings in the page encoding, I've set it to utf-8.


Thank you again,


Julien

--
Jul... réapparru comme par enchantement

.