use Encode qw(from_to); ... from_to($string, 'UTF-16le', 'UTF-8');