use Encode qw( decode_utf8 ); my $string = <>; my $utf8_string = decode_utf8($string);