Perl Requires Chilkat v11.1.0+
Chilkat2 Perl
HTML Encoding
Demonstrates HTML encoding and decoding.Chilkat Perl Downloads
use strict;
use warnings;
use Chilkat2;
my $crypt = Chilkat2::Crypt2->new;
my $s = '< é ü ç Ω Hello & World ✓ >';
my $htmlEncoded = $crypt->EncodeString($s, 'utf-8', 'html');
print $htmlEncoded, "\n";
# Output:
# < é ü ç Ω Hello & World ✓ >
# To decode:
$s = $crypt->DecodeString($htmlEncoded, 'utf-8', 'html');
print $s, "\n";
# Output:
# < é ü ç Ω Hello & World ✓ >