Part of the explanation mentions @XML::Parser::Expat::Encoding_Path, which is a list of one or more directories where encoding definitions are kept. You're likely to find a directory called "Encodings" under XML/Parser/ (wherever this module was installed on your system).
On the system I'm using at the moment (macosx, perl 5.8.6, XML::Parser version 2.34), that Encodings directory contains the follow shift-jis related encoding map files:
If I take the xml snippet from the OP, and change the name of the encoding from "shift-jis" to "x-sjis-unicode", it does not generate an error.x-sjis-cp932.enc x-sjis-jdk117.enc x-sjis-jisx0221.enc x-sjis-unicode.enc
Also, rather than altering the xml data file, if I get my xml object like this:
this encoding spec overrides the encoding named in the xml file, and it generates no error. (And of course, if I use the data as posted and do not set ProtocolEncoding for the parser object, I get the same error as the OP.)my $parser = new XML::Parser(ProtocolEncoding=>"x-sjis-unicode");
I'm just guessing that the one I picked is "the right one". Good luck with that.
In reply to Re: Parsing shift-jis XML with XML::TWIG
by graff
in thread Parsing shift-jis XML with XML::TWIG
by jabarin
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |