如果可以用iconv函数的话,就直接用
iconv("EUC-KR", "UTF-8", $str);php4没有安装iconv扩展的话就麻烦了,需要一个码表或者javascript方法:
先将页面设成euc-kr编码
然后
function convert(str)
{
for (i=0;i<str.length;i++)
{
newstr += str.fromCharCode(str.charCodeAt(i));
}
return newstr;
}
iconv("EUC-KR", "UTF-8", $str);php4没有安装iconv扩展的话就麻烦了,需要一个码表或者javascript方法:
先将页面设成euc-kr编码
然后
function convert(str)
{
for (i=0;i<str.length;i++)
{
newstr += str.fromCharCode(str.charCodeAt(i));
}
return newstr;
}
//newstr += String.fromCharCode(str.charCodeAt(i));