avih has asked for the wisdom of the Perl Monks concerning the following question:
Hello monks, I'm trying to parse the example xml below, which contains Latin chars, using the XML DOM parser in code that follows. The object returned by the parser contains jibberish instead the Latin letters.
xml:
<?xml version="1.0" encoding="UTF-8"?> <Name>IssuéTést</Name>
code:
use XML::DOM; my $XmlParserObj = XML::DOM::Parser->new(); my $doc = $XmlParserObj->parsefile("in.xml"); my $str = $doc->toString(); print $str;
The output xml I get is:
<?xml version="1.0" encoding="UTF-8"?> <Name>Issu㩔st</Name>
Any advice on how can I get the exact chars in the output, or at least with the correct escape chars? Thanks!
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: error parsing utf8 chars using XML DOM parser
by Ninthwave (Chaplain) on Nov 01, 2011 at 15:07 UTC | |
Re: error parsing utf8 chars using XML DOM parser
by ikegami (Patriarch) on Nov 01, 2011 at 20:14 UTC | |
Re: error parsing utf8 chars using XML DOM parser
by Anonymous Monk on Nov 01, 2011 at 15:10 UTC | |
by avih (Initiate) on Nov 01, 2011 at 17:31 UTC | |
by choroba (Cardinal) on Nov 01, 2011 at 18:04 UTC | |
by avih (Initiate) on Nov 03, 2011 at 08:25 UTC |
Back to
Seekers of Perl Wisdom