in reply to Re: Problem upgrading XML::Fast from 0.11 to 0.17
in thread Problem upgrading XML::Fast from 0.11 to 0.17
Hi,
It is the parser's job to handle decoding.
To do so, the parser needs to know the encoding of the XML.
The XML declaration (<?xml version="1.0" encoding="ISO-8859-1"?>) does provide that information for the parser.
$xml =~ s/^(?:.*\n)//; # remove first line - the encoding lineBy removing the XML declaration the Parser seems to guess the (wrong) source encoding. uses the default encoding.*
With XML declaration your code seems to work correctly. Please notice that XML::Fast upgrades the data to utf8. But now in the correct manner.
*updated
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: Problem upgrading XML::Fast from 0.11 to 0.17
by ikegami (Patriarch) on Sep 23, 2017 at 04:02 UTC | |
by ablanke (Monsignor) on Sep 23, 2017 at 09:52 UTC | |
Re^3: Problem upgrading XML::Fast from 0.11 to 0.17
by mje (Curate) on Sep 25, 2017 at 11:55 UTC |
In Section
Seekers of Perl Wisdom