in reply to Encoding all HTML entities except < and >
That seems like a bit of a strange request to me, could you explain some more what you need this for?
Anyway, this works for me:
use HTML::Entities; my $str = "'Hello\" & <World>"; encode_entities($str, q{&"'}); print $str, "\n"; # prints 'Hello" & <World>
But what do you mean by "all HTML entities"? Do you include e.g. non-ASCII characters in that definition? (And what encoding are you using for your HTML files?) Could you show some representative example input and the expected output for that?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Encoding all HTML entities except < and >
by TrixieTang (Sexton) on Oct 15, 2019 at 20:19 UTC |