gb2312转Utf的方法:
use Encode;
my $str = "中文";
$str_cnsoftware = encode("utf-8", decode("gb2312", $str));
my $str = "中文";
$str_cnsoftware = encode("utf-8", decode("gb2312", $str));
Utf转
gb2312的方法:
use Encode;
my $str = "utf8中文";
$str_cnsoftware
= encode("gb2312", decode("utf-8", $str);
转自
http://www.sysab.cn/a/pro/perl/2009/1204/7951.html
本文介绍了一种使用Perl语言实现的字符集转换方法,具体为如何将GB2312编码的字符串转换成UTF-8编码,以及如何从UTF-8编码转换回GB2312编码。
726

被折叠的 条评论
为什么被折叠?



