Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: decode characters from file using HTML::Entities

by ikegami (Pope)
on Feb 18, 2011 at 16:18 UTC ( #888940=note: print w/replies, xml ) Need Help??


in reply to decode characters from file using HTML::Entities

There are no HTML entities in that file. HTML entities start with "&", but there are no "&" in that file. Where one would expect a "&", there's "\","x","2","6".

The second snippet decodes an entirely different string. Whereas you decode «Thomas Ack\x26#39\x3Bhing» in the first snippet, you construct and decode «Thomas Ack'hing» in the second snippet.

Replies are listed 'Best First'.
Re^2: decode characters from file using HTML::Entities
by Anonymous Monk on Feb 18, 2011 at 16:37 UTC
    Ah I understand (maybe :)),

    i think i forgot about double quotes (so \x26 is actually "&"), correct ?

    So i guess the right tool is to use Encode..

      Yes, the Perl string literal «"\x26"» evaluates to the string «&».

      No idea what Encode has to do with this.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (4)
As of 2018-12-17 07:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many stories does it take before you've heard them all?







    Results (71 votes). Check out past polls.

    Notices?
    • (Sep 10, 2018 at 22:53 UTC) Welcome new users!