Re: [XML::Simple-2.12] problems parsing non ASCII strings
- From: "Jul" <julien@mesnews>
- Date: Sun, 17 Jul 2005 02:55:47 +0200
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
.
- 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
- Re: [XML::Simple-2.12] problems parsing non ASCII strings
- From: Michel Rodriguez
- [XML::Simple-2.12] problems parsing non ASCII strings
- Prev by Date: Re: How to Install Inline:CPP module
- Next by Date: Best HTML Templating Module
- Previous by thread: Re: [XML::Simple-2.12] problems parsing non ASCII strings
- Next by thread: FindBin cannot chdir back problem
- Index(es):