perl的中文字符集转换的例子

来源:互联网 发布:nginx ip限制 编辑:程序博客网 时间:2024/06/06 17:37

#!/usr/bin/perl
use Encode;

$^I = "";
#open TEST_A, ">file1.txt";
while (<>)
{
 print $_;
 
 $AAA = encode("ISO-8859-1", decode("utf8",$_));
 print $AAA; 
 #$AAA = encode("gb2312", decode("utf8",$_));
 #print TEST_A "$AAA";
}

#close TEST_A;

 

原创粉丝点击