sandy1028 has asked for the wisdom of the Perl Monks concerning the following question:
output is :#!/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";
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 furtherTo 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;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: replace &
by wfsp (Abbot) on Jun 04, 2009 at 07:02 UTC | |
by sandy1028 (Sexton) on Jun 04, 2009 at 07:26 UTC | |
by Anonymous Monk on Jun 04, 2009 at 07:39 UTC | |
by sandy1028 (Sexton) on Jun 04, 2009 at 07:42 UTC | |
by Corion (Patriarch) on Jun 04, 2009 at 07:46 UTC | |
by sandy1028 (Sexton) on Jun 04, 2009 at 08:04 UTC | |
| |
by ig (Vicar) on Jun 04, 2009 at 10:03 UTC | |
|
Re: replace &
by Anonymous Monk on Jun 04, 2009 at 06:50 UTC |