0
我在Windows 7(32位)上运行Active Perl 5.16.3。输出文件的Perl(错误?)编码
我的(短)程序按摩输入文本文件(以UTF-8编码)。我希望输出的编码为Latin1,所以我的代码是:
open (OUT, '>;encoding(Latin1)', "out.txt") || die "Cannot open output file: $!\n";
print OUT "$string\n";
尚未生成的文件仍处于UTF-8状态。我究竟做错了什么?
你真的在打开模式字符串中有分号吗?它应该是冒号 - '>:encoding(Latin1)' – Borodin