Hi, all:
I use the make_encmap and compile_encoding from the XML-Encoding module
to build the gb2312.enc file. The encoding map file gb2312.txt is from
unicode site. then gb2312.enc file is copied to perl Encoding directory.
But i still can not use this enc file.
1. Big5 encoding xml file works well, there is a "big5.enc" in the same
diretory where the gb2312.enc file is.
2. when changing the coding name "big5" to "dddddbig5". the XML-Parse's
sample file xmlstats reports that the encoding file dddddbig5 doesn't
exist. This means the module tried to find file from the correct
directory.
Thus, Encoding_Path was set correctly.
3. when using a GB2312 xml file to test the program xmlstats, there has two
kinds of errors:
using
my $parser = new XML::Parser(ErrorContext => 2, ProtocolEncoding =>
'GB2312');
the error is strange:
[root@guotu samples]# perl xmlstats gbtest13.xml
Name "XML::Parser::Encoding_Path" used only once: possible typo at xmlstats
lin.
unknown encoding at line 1, column 0, byte -1:
13^
6326624
at /usr/lib/perl5/site_perl/5.005/i386-linux/XML/Parser.pm line 183
when unchange the new statment for XML::Parse, but
XML::Parser::Expat::load_encoding('gb2312');
error becomes:
[root@guotu samples]# perl xmlstats gbtest13.xml
Name "XML::Parser::Encoding_Path" used only once: possible typo at xmlstats
lin.
unknown encoding at line 1, column 30, byte 30:
<?xml version="1.0" encoding="gb2312" standalone="yes" ?>
=============================^
<?xml-stylesheet type='text/css'
href='http://www.ascc.net/xml/test/style.css' >
<!DOCTYPE test SYSTEM 'http://www.ascc.net/xml/test/test.dtd'>
at /usr/lib/perl5/site_perl/5.005/i386-linux/XML/Parser.pm line 183
How come it doesn't understand the "gb2312" name? i have checked the
expat.pm file. The enc file is loaded correctly. The error is from
parse functin in expat.c, further from the parse_stream function.
Thanks
fan
---
You are currently subscribed to perl-xml as: [[email protected]]
To unsubscribe, forward this message to
[EMAIL PROTECTED]
For non-automated Mailing List support, send email to
[EMAIL PROTECTED]