Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

XML::Twig (keep_encoding)

by arivu198314 (Sexton)
on May 07, 2012 at 13:37 UTC ( #969259=perlquestion: print w/replies, xml ) Need Help??
arivu198314 has asked for the wisdom of the Perl Monks concerning the following question:

I'm wondering this object is working or not, because I'm sending the input as UTF-8 characters, but the twig is returning back as junk, see below for more...


<title>Division II the Sources of Lawyers’ Legal and Ethical Duties</t +itle>

Output: the Original symbol replaced by entity values, its actually two small boxes in the original output

<title>The Sources of Lawyersâ&#128;&#153; Legal and Ethical Duties</title>

My bit of code is below

use open qw/:std :utf8/; XML::Twig->new(keep_encoding=>1)

It would be great if anyone give a needful solution for this

Replies are listed 'Best First'.
Re: XML::Twig (keep_encoding)
by mirod (Canon) on May 07, 2012 at 15:41 UTC

    If you post your complete code, we'll have a better chance to figure out what you are doing. What you posted doesn't output anything!

    That said, if you're dealing with UTF-8 input, don't use keep_encoding, it's there mostly for dealing with other encodings.

      I know its very hard to find out the error without code, but i need some random answer just like this, means i have used both UTF-8 as well as keep_encoding, now i have removed it and it is working great.

      Thank you so much for this...

Re: XML::Twig (keep_encoding)
by zwon (Abbot) on May 07, 2012 at 14:39 UTC
    Could you provide us with a complete example demonstrating the problem. Note, that use open only affect opens within a lexical scope of the pragma, it has no effect on opens inside XML::Twig.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://969259]
Front-paged by Corion
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (10)
As of 2018-10-16 14:15 GMT
Find Nodes?
    Voting Booth?
    When I need money for a bigger acquisition, I usually ...

    Results (85 votes). Check out past polls.