Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^3: HTML::Entities encode_entities for perlmonks [ ]

by trizen (Friar)
on Jun 15, 2013 at 10:10 UTC ( #1039101=note: print w/ replies, xml ) Need Help??


in reply to Re^2: HTML::Entities encode_entities for perlmonks [ ]
in thread HTML::Entities encode_entities for perlmonks [ ]

Why not just encode the other characters manually?

use HTML::Entities ; my $string = '[< smarto >]'; my $unsafe_chars = '[]'; my $encoded = encode_entities($string) =~ s{([\Q$unsafe_chars\E])}{sprintf"&#%d;",ord$1}egr; print "$string\n$encoded\n";


Comment on Re^3: HTML::Entities encode_entities for perlmonks [ ]
Download Code
Re^4: HTML::Entities encode_entities for perlmonks [ ] (fix knife)
by Anonymous Monk on Jun 15, 2013 at 10:46 UTC

    Why not just encode the other characters manually?

    :) Q: How do I fix this here knife? A: Why not use another knife?

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (12)
As of 2014-12-18 13:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (51 votes), past polls