Got a request?
Email us...

ActionScript Reference crumb.gif PHPObject Class crumb.gif PHPObject.utf8encode()

PHPObject.utf8encode()

Note
This pertains to the PHPObject class, available if the PHPObject extension is installed (available from Macromedia Exchange).

Description
Method. Switches on/off the utf8 encoding of results by the server. By default the gateway returns results back to Flash utf8 encoded, which is what you will want most of the time. However, when you consume web services, the results from the web services are usually already utf8 encoded. In this case, if we do not switch off the utf8 encoding in the gateway, you will receive messages that are encoded twice, resulting in garbled characters for unicode characters.

Syntax
PHPObject.utf8encode(flag)
flag Boolean, true or false

Example
--------------------------------------------------------------------------------
// Actionscript
mySvc = new PHPObject("http://api.google.com/GoogleSearch.wsdl");
mySvc.utf8encode(false);
mySvc.onResult =function(result)
{
// handles result
}
mySvc.doGoogleSearch(
"key","licensekey",// enter your license key
"q",query_txt.text,// the query terms, which we get from the input field
"start",offset, // Zero-based index of the first desired result
"maxResults",10,// Number of results desired per query; max 10
"filter",false,// similar results filter
"restrict","",// country or topic filter
"safeSearch",false,// adult content filter
"lr",""// language restrict
);
--------------------------------------------------------------------------------

REFERENCE SEARCH


RELATED ENTRIES

...Object.getOutput()
PHPObject.execute()
...ect.delayExecute()
...ect.abortExecute()
PHPObject()

LINK TO US