Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Substitute some Unicodes with their escapes

by Corion (Patriarch)
on Jun 09, 2020 at 13:56 UTC ( [id://11117867]=note: print w/replies, xml ) Need Help??


in reply to Substitute some Unicodes with their escapes

Have you looked at HTML::Entities, which has

$encoded = encode_entities($input, '^\n\x20-\x25\x27-\x7e');

... which should be more or less what your table does.

If you have other characters that should not be encoded, you can add them to the above range.

Update: See also HTML::HTML5::Entities, which even allows you to bring your own entity tables.

Replies are listed 'Best First'.
Re^2: Substitute some Unicodes with their escapes
by jjmoka (Beadle) on Jun 09, 2020 at 14:57 UTC
    That's another good idea. Thank you
Re^2: Substitute some Unicodes with their escapes
by Anonymous Monk on Jun 09, 2020 at 15:05 UTC
    Superficial glances at the source-code of each module indicates that both of them in their own way know about "&Ouml." I think you'll be in business with either one of them.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (6)
As of 2024-04-18 19:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found