Subject: | Error when loading single string binary plist |
Date: | Mon, 22 Sep 2014 22:03:47 -0300 |
To: | bug-Mac-PropertyList-XS [...] rt.cpan.org |
From: | "Richard Faasen" <richie765 [...] gmail.com> |
When loading a single string binary plist file, I get the following
error:
not well-formed (invalid token) at line 1, column 16, byte 16 at
/..../perl-5.18.2/lib/site_perl/5.18.2/darwin-thread-multi-2level/XML/Parser.pm
line 187.
The error also occurs with Mac::PropertyList::SAX. It works well with
Mac::PropertyList and with XML property lists with all three modules.
Steps to reproduce.
cat << EOF > xml.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<string>Just a string</string>
</plist>
EOF
plutil -convert binary1 xml.plist -o binary.plist
# working
perl -MMac::PropertyList=:all -MData::Dumper -e'print Dumper
parse_plist_fh(*STDIN)->as_perl;' < xml.plist
perl -MMac::PropertyList::XS=:all -MData::Dumper -e'print Dumper
parse_plist_fh(*STDIN)->as_perl;' < xml.plist
perl -MMac::PropertyList::SAX=:all -MData::Dumper -e'print Dumper
parse_plist_fh(*STDIN)->as_perl;' < xml.plist
perl -MMac::PropertyList=:all -MData::Dumper -e'print Dumper
parse_plist_fh(*STDIN)->as_perl;' < binary.plist
# not working
perl -MMac::PropertyList::XS=:all -MData::Dumper -e'print Dumper
parse_plist_fh(*STDIN)->as_perl;' < binary.plist
perl -MMac::PropertyList::SAX=:all -MData::Dumper -e'print Dumper
parse_plist_fh(*STDIN)->as_perl;' < binary.plist
# Result
not well-formed (invalid token) at line 1, column 16, byte 16 at
/..../perl-5.18.2/lib/site_perl/5.18.2/darwin-thread-multi-2level/XML/Parser.pm
line 187.
# Expected result
$VAR1 = 'Just a string';