Perl Requires Chilkat v11.1.0+
Chilkat2 Perl
HTML Entity Encode and Decode in StringBuilder
Demonstrates HTML encoding and decoding the contents of a StringBuilder.Chilkat Perl Downloads
use strict;
use warnings;
use Chilkat2;
my $sb = Chilkat2::StringBuilder->new;
my $s = '< é ü ç Ω Hello & World ✓ >';
$sb->Append($s);
$sb->Encode('html', 'utf-8');
print $sb->GetAsString(), "\n";
# Output:
# < é ü ç Ω Hello & World ✓ >
# To decode:
$sb->Decode('html', 'utf-8');
print $sb->GetAsString(), "\n";
# Output:
# < é ü ç Ω Hello & World ✓ >