#!/usr/bin/perl;
use HTML::Entities;
$to_decode = "TEST&TEST;A&E&an HTML--- string - <© T
+VS>";
#$decoded = decode_entities($to_decode);
$encoded = encode_entities($to_decode);
print "To decode --> $to_decode\n";
print "Encoded data --> $encoded\n";
output is :
To decode --> TEST&TEST;A&E&an HTML--- string - <© T
+VS>
Encoded data --> TEST&TEST;A&E&an&nbsp;HTML---&nbs
+p;string - &lt;&copy; TVS&gt;
the expected output is
TEST&TEST;A&E&an HTML--- string - <© TVS>
Here all the & is replacing with &.
If it is HTML entity I have to write a code which will not repalce it. Please help me how to proceed further