in reply to Encode string to HTML
You aren't decoding your source string first.
use strict; use warnings; use HTML::Entities; use Encode; my $TestStr = 'ï'; print encode_entities($TestStr) . "\n"; print encode_entities(decode ('utf-8', $TestStr)) . "\n";
Have a read of perlunitut if you haven't already. It'll explain the basics.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Encode string to HTML
by Corion (Patriarch) on Nov 01, 2013 at 14:50 UTC | |
by hippo (Archbishop) on Nov 01, 2013 at 15:06 UTC | |
by gepebril69 (Scribe) on Nov 01, 2013 at 15:27 UTC | |
|
Re^2: Encode string to HTML
by gepebril69 (Scribe) on Nov 01, 2013 at 15:22 UTC |