http://qs321.pair.com?node_id=640604


in reply to HTML::Entities - encode all non-alphanumeric and foreign chars?

Your problem is easier if you invert how you express the requirements: Rather than encode everything non-English + non-alphanumeric, encode everything but the English alphanumerics. Which ought to be something like this, depending on your idea of "English alphanumerics":

$encoded = encode_entities($input, '\W');

or ...

$encoded = encode_entities($input, '^\w');

or ...

$encoded = encode_entities($input, '^a-zA-Z0-9_');

(That these follow the regex character class syntax is not actually documented, but I'd be surprised to see it stop working. Certainly, as you noted, the use of hyphen to denote character ranges is documented ...)

print "Just another Perl ${\(trickster and hacker)},"
The Sidhekin proves Sidhe did it!