Re: [XML::Simple-2.12] problems parsing non ASCII strings
- From: Michel Rodriguez <mirod@xxxxxxxxx>
- Date: Wed, 13 Jul 2005 07:39:00 +0200
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 .
- Follow-Ups:
- References:
- [XML::Simple-2.12] problems parsing non ASCII strings
- From: Jul
- Re: [XML::Simple-2.12] problems parsing non ASCII strings
- From: Michel Rodriguez
- Re: [XML::Simple-2.12] problems parsing non ASCII strings
- From: Jul
- [XML::Simple-2.12] problems parsing non ASCII strings
- Prev by Date: Re: GD.pm Makefile not installing GD::Polyline
- Next by Date: Re: Win32::Printer::Enum::Printer($server)
- Previous by thread: Re: [XML::Simple-2.12] problems parsing non ASCII strings
- Next by thread: Re: [XML::Simple-2.12] problems parsing non ASCII strings
- Index(es):