use Encode;
gbk转uft-8:
$line = encode("utf-8",decode("gbk",$line));
或
$line = encode_utf8(decode("gbk",$line));
utf-8转gbk:
$line = encode("gbk", decode("utf8", $line));
uft-8转gb2312:
$line = encode("gb2312", decode("utf8", $line));
use Encode;
gbk转uft-8:
$line = encode("utf-8",decode("gbk",$line));
或
$line = encode_utf8(decode("gbk",$line));
utf-8转gbk:
$line = encode("gbk", decode("utf8", $line));
uft-8转gb2312:
$line = encode("gb2312", decode("utf8", $line));