use utf8; # Skript in UTF-8 kodiert use Encode qw( encode ); my $str = "Ä Ö Ü ß €\n"; if ( $^O eq "MSWin32" ) { $str = encode( "cp1252", $str ); system( "chcp 1252" ); } print $str; my $res_file = "erg_1252.txt"; open( my $fh, ">", $res_file ) or die "Could not open file '$res_file'"; print $fh $str; close $fh;