my $str = "Ä Ö Ü ß €\n"; 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;