http://www.perlmonks.org?node_id=788955


in reply to UTF-8: Trying to make sense of form input

Don't look at is_utf8. That's going down the wrong path.

Given this, I decided to use HTML::Entities to convert characters such as £ to £. This is where things got more confusing.

If param foo is encoded using UTF-8 and consists of text with HTML entities, you want

my $text = decode_entities(decode('UTF-8', $cgi->param('foo')));

Don't forget to encode the result if you output it in part of full (using encode or binmode :encoding on the output handle).