my $data = encode_utf8 decode "windows-1252", $testtext; open my $fh, ">", "bla.txt" or die $!; print $fh $data;