use Unicode::String;my $string = "This is a test\n";my $u = Unicode::String->new($string);# print as UCS2print $u->ucs2;