perl 在win下输出中文乱码问题

时间:2017-02-19 23:57:50   收藏:0   阅读:1386
 1 use utf8;
 2 my $name = 你好;
 3 #binmode(STDOUT, ":encoding(gbk)");
 4 print $name,"\n";
 5 
 6 # #或
 7 # use Encode;
 8 # my $str=‘你好‘;
 9 # $str = encode("gbk", decode("utf-8", $str));
10 # print $str,"\n";

 

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!