perl utf8 转gbk

前端之家收集整理的这篇文章主要介绍了perl utf8 转gbk前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
use Encode; if ( $#ARGV < 0 ){         print "请输入一个文件\n";         exit(-1);     }   $var = $ARGV[0]; open (FILE,"<","$var") || die "can open file$!\n"; while (<FILE>) { $str = encode("gbk",decode("utf8","$_")); print "$str" ; } close FILE;

猜你在找的Perl相关文章