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

#!/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;

 

你可能感兴趣的:(File,perl)