in reply to Re: XML::Twig - Parsing XML file with incorrect encoding in declaration
in thread [SOLVED] XML::Twig - Parsing XML file with incorrect encoding in declaration
Can you try slurping in the XML content, and using perl to zap the encoding, before feeding to XML::Twig ?
That's what I figured I would need to do (reading in 128 MiB chunks in this case; 73 GiB is a bit much to slurp in all at once ;) ). I just wanted to see if there was an "official" method before I broke out the full brute-force nuclear option.
(Of course it probably goes without saying that the ideal solution is to fix this fluster-cluck of an XML travesty...)
EDIT:
I just saw the SO link in your update after I posted my reply. That particular example will not work in this because the data is not UTF-16 even though the encoding says otherwise.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: XML::Twig - Parsing XML file with incorrect encoding in declaration
by NetWallah (Canon) on Sep 02, 2017 at 01:07 UTC | |
by ateague (Monk) on Sep 18, 2017 at 13:42 UTC |