amfphp传递中文乱码问题

晕,最终还是解决了~~
AMFPHP 1.9里直接使用中文会在传递数据时发生乱码,这个问题在AMFPHP中的gateway.php文件就已经给出了解决方法。
见gateway.php文件中的注释:
// Oriental languages (Chinese, japanese, korean):
$gateway->setCharsetHandler( "none", "ISO-8859-1", "ISO-8859-1" );
$gateway->setCharsetHandler( "iconv", "big5", "big5" );
$gateway->setCharsetHandler( "iconv", "CP950", "CP950" );
$gateway->setCharsetHandler( "iconv", "Shift_JIS", "Shift_JIS" );
$gateway->setCharsetHandler( "iconv", "CP932", "CP932" );
$gateway->setCharsetHandler( "iconv", "CP949", "CP949" );
也就是说你的文件是用什么格式编码的,就把gateway.php文件中的$gateway->setCharsetHandler( "iconv", "big5", "big5" );中的两个“big5”改成相对应的编码名称就可以了。而在中国,一般使用“utf-8”、“gb2312”和“big5”,我用“utf-8”,所以 在gateway.php文件中找到$gateway->setCharsetHandler("utf8_decode", "ISO-8859-1", "ISO-8859-1");一行代码,把它改成$gateway->setCharsetHandler("iconv", "UTF-8", "UTF-8"); 能正常传递中文数据了!

你可能感兴趣的:(amfphp传递中文乱码问题)