Home
HomeFlexible, Lightweight and Truly Skinnable Flash ComponentsPHPObject and other Flash ExtensionsForumsBlog JournalLinks
Buy Flash Components
  PHPObject - Opensource PHP Flash Remoting

redhand Using PHPObject (MultiByte Characters)

As of v1.45, multibyte characters encoded in UTF8 will work correctly with PHPObject.  However, support for multibyte characters is not enabled by default - you need to make some changes (as specified below).  Note that multibyte characters support increases the message sizes quite significantly - do not enable it unless you really need to!


Server
To enable support for multibyte characters, you need to set the $cfg['multiByte'] in config.php to 'true'.  Remember that the config.php file should be in the same directory as Gateway.php.  No other changes or installation of plugin is required.


Flash/Actionscript
In Flash, before declaring the PHPObject, add the following statement:
Serializer.enableMultiByte = true;

Example:
(Actionscript 1.0)
#include "PHPObject.as"
_global.defaultGatewayUrl = "http://mydomain.com/services/Gateway.php";
_global.defaultGatewayKey = "secret";
Serializer.enableMultiByte = true;

(Actionscript 2.0)
import com.ghostwire.phpobject.*
PHPObject.defaultGatewayUrl = "http://mydomain.com/services/Gateway.php";
PHPObject.defaultGatewayKey = "secret";
PHPObject.enableMultiByte = true;
// notice that we set the defaults at the PHPObject class level instead of global level
// and the enableMultiByte is set at the PHPObject class level as well



Content
Remember that you need to UTF8-encode your content.  If the multibyte characters originate from the Flash-end, it is already UTF8 encoded (by Flash).  If the text originates from the server, a database, or a text file, make sure it is UTF8-encoded.


>> Documentation <<

 
Contact UsSite Map
Copyright © 2003-2006 GhostWire Studios