use strict; use warnings; use HTML::Entities qw(decode_entities); use CGI; use Encode; my $title = decode_entities('xXxXxX™'); my $cgi = new CGI; print $cgi->header(-charset => 'utf-8'), $cgi->start_html(encode("utf-8",$title)); #### Content-Type: text/html; charset=utf-8 xXxXxX™