Beefy Boxes and Bandwidth Generously Provided by pair Networks Frank
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: XML::Parser and numeric entities

by ikegami (Pope)
on Jan 14, 2010 at 02:53 UTC ( #817327=note: print w/ replies, xml ) Need Help??


in reply to XML::Parser and numeric entities

It simply decodes the entities. It doesn't then encode the character using UTF-8.

If you want all non-ASCII characters encoded, you can use:

use HTML::Entities qw( encode_entities_numeric ); sub handle_char { my $self = shift; my $x = shift; print encode_entities_numeric($x); }

There's also a handler you can use instead of Char that receives the entities still encoded, but then you're not guaranteed to have all non-ASCII characters encoded.


Comment on Re: XML::Parser and numeric entities
Download Code
Re^2: XML::Parser and numeric entities
by gam3 (Curate) on Jan 14, 2010 at 10:50 UTC
    Thank you for that information, I can use it to patch up my problem

    However what I really want is for XML::Parser to NOT decode the numeric entities at all.

    -- gam3
    A picture is worth a thousand words, but takes 200K.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://817327]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (5)
As of 2014-04-17 02:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (437 votes), past polls