use Encode qw(decode); my $utf8_data = decode("UTF-16", $input);