分类: PERL
2015-04-07 00:14:29
use Encode;
#gbk转utf-8
$str = encode("utf8",decode("gbk",$str));
#gbk转utf-8方法二
$str = encode_utf8(decode("gbk",$str));
#utf-8转gbk
$str = encode("gbk",decode("utf8",$str));
#utf-8转gb2312
$str = encode("gb2312",decode("utf8",$str));
perl 只识别 UTF8编码的字符串(TK)