Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Help with HTML::Entities - decode_entities

by ikegami (Patriarch)
on Jul 09, 2010 at 00:23 UTC ( [id://848790]=note: print w/replies, xml ) Need Help??


in reply to Help with HTML::Entities - decode_entities

Even if it was possible to do what you want with HTML::Entities — and it looks like you can't — It would make most sense to just use

$mystring =~ s/&#59;/;/g; $mystring =~ s/&/&/g;

That said, decoding "&" without decoding all other entities creates garbage. For example

é

and

é

are clearly not equivalent, but they produce the same string under your requirements.

Replies are listed 'Best First'.
Re^2: Help with HTML::Entities - decode_entities
by punch_card_don (Curate) on Jul 09, 2010 at 00:38 UTC
    You've inferred the problem I'm tryuing to solve. Recursive use of encode_entities has filled a db with entries like é, which display, as you say, like garbage in the client. Was hoping to just de-decode them before output, but we'll go regex.

    Thanks again.




    Time flies like an arrow. Fruit flies like a banana.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (3)
As of 2024-03-28 13:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found