Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^2: HTML::Treebuilder Special characters

by jai_dgl (Beadle)
on Sep 08, 2009 at 14:59 UTC ( [id://794153]=note: print w/replies, xml ) Need Help??


in reply to Re: HTML::Treebuilder Special characters
in thread HTML::Treebuilder Special characters

I get the proper content from the page with the same look and feel
plain text : ü
but when the HTML content is parsed using HTML::TreeBuilder the
plain text is converted into HTML codes.

Thanks
Jey
  • Comment on Re^2: HTML::Treebuilder Special characters

Replies are listed 'Best First'.
Re^3: HTML::Treebuilder Special characters
by jai_dgl (Beadle) on Sep 17, 2009 at 09:20 UTC
    This function helped me to solve the issue
    sub encode_entities_decimal { my $text = shift; $text =~ s{([^\0-\x7f])}{sprintf("&#%d;",ord($1))}ge; $text; }

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (None)
    As of 2024-04-25 00:55 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      No recent polls found