my $uni = decode("Windows-1252", $input); $uni =~ s/(.)/sprintf "\\u%04X", ord $1/ge; print $uni, "\n";