I have a test string like :
my $input = "testing &test ₨";
my $output = HTML::Entities::encode_entities($str,"<>&\"'");
The desired output is
testing &test ₨
But HTML::Entities::encode_entities is encoding this into
testing &test &#8360;
To summarize, I want the HTML::Entities to encode the “&” character only if it does not represent an HTML entity number.
You need to decode the string first, then encode it:
The result is
20A8is the hexadecimal version of8360.