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



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?

--
mirod
.