I have also verified that reading the XML file and writing it out again like so:Probably string downgrading issue again. Try to
put that on top of your program.binmode STDOUT, ':encoding(utf-8)';
If that doesn't work, post the output of
(with problematic strings)my $xp = XML::XPath->new(xml => $xml) or die "ERROR: XML::XPath cannot parse target file: $!\n"; my $contrib_nodeset = $xp->find('/contrib[@contrib-type="author"]'); foreach my $contrib_node ($contrib_nodeset->get_nodelist) { my $given_names = $xp->find('./name/given-names', $contrib_node); my $surname = $xp->find('./name/surname', $contrib_node); printf "given_names => (%d) %vx\nsurname => (%d) %vx\n", utf8::is_utf8($given_names), $given_names, utf8::is_utf8($surname), $surname; }
In reply to Re: XML::XPath and character encoding
by Anonymous Monk
in thread XML::XPath and character encoding
by mboudreau
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |