开发者

read content of file with php and send to flex via amfphp

I am creating some application in flex and one of my purposes is to read content of file and display it in flex. There is huge problem, when I have file written in polish (which con开发者_如何学Gotains some special characters) because amfphp transfers this contents few seconds, which is to long (reading and sending content of file without any polish character if fast).My php code reads any files fast, so problem is on amfphp side. Is there any solution or I have to go with HTTPService and load contents of file directly from flex?? Thanks for any tips.


Amfphp uses the charset ISO-8859-1 by default, and those special characters are not supported by ISO-8859-1. Flash does support special characters because it uses UTF-8 by default. You need to change the setting in gateway.php. Finding a line like

$gateway->setCharsetHandler( "utf8_decode", "ISO-8859-1", "ISO-8859-1" );

and replace with

$gateway->setCharsetHandler("utf8_decode", "UTF-8", "UTF-8");

You can read the notes at the beginning of gateway for reference.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜