Re: XML::LibXML: UTF8 not being set properly on toString of Document
Petr Pajas <[email protected]>
| Newsgroups | gmane.comp.lang.perl.xml |
|---|---|
| Organization | UFAL MFF UK |
| Message-ID | <[email protected]> |
On Tuesday 12 August 2008, David Steinbrunner wrote: > Petr Pajas wrote: > > No, > > > > the change of behavior of XML::LibXML::Document's toString method in > > versions > > > > >= 1.63 is documented and won't be reverted in any future release. > > > > See the corresponding manpage and also the section on Encoding Support in > > XML::LibXML man page. > > > > The details have been discussed on this list previously. Hi David, > Dealing with the activestate mailing list interface seems less than > pleasant so a post on the subject that had been answered did not pop up for > me. sure, and I only meant that as a pointer for further reading, not as a complaint that you brought the topic back. > I did hit the pod for Encoding Support and I think I groked it. While I > was at it I whipped up a diff with typo corrections as proof that I paid > attention... Thanks a lot! > I'm guessing the best way to keep code working that might interface with > different version of XML::LibXML is to use a conditional on: > > $XML::LibXML::LIBXML_VERSION >= 1.63 > > at the point of writing out the results of $doc->toString, correct? yes. You can possibly approximate the pre-1.63 behavior by turning the UTF8 flag on if the actualEncoding method returns 'UTF-8'. Any further processing of the resulting scalar (such as printing it out) will then have to be different for the case when the flag is on and when it is not. But a better approach is to strip the UTF8 flag off for pre-1.63 versions. -- Petr _______________________________________________ Perl-XML mailing list [email protected] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs