Hey!
I’m trying to read data from a webservice that returns an XML response.
I am using the following code for that:
private function NewWordRequest(Letters:String, Contains:String, BeginsWith:String, EndsWith:String):void
{
var requestVars:URLVariables = new URLVariables();
requestVars.Word = Letters;
requestVars.Contains = Contains;
requestVars.BeginsWith = BeginsWith;
requestVars.EndsWith = EndsWith;
var request:URLRequest = new URLRequest("http://localhost:12459/ScrabbleSolver.svc/post");
request.method = URLRequestMethod.POST;
request.data = requestVars;
request.cacheResponse = false;
//Initiate the request
var requestor:URLLoader = new URLLoader();
requestor.dataFormat = URLLoaderDataFormat.TEXT;
requestor.requestor.addEventListener( Event.CHANGE, loadListener);
requestor.addEventListener( Event.COMPLETE, xmlRPCRequestComplete );
requestor.addEventListener( IOErrorEvent.IO_ERROR, xmlRPCRequestError );
requestor.addEventListener( SecurityErrorEvent.SECURITY_ERROR, xmlRPCRequestError );
requestor.load( request );
}
When debugging the webservice the swedish letters from flash are being sent correctly to the service but when comming back and tracing the response I get something like this:
<ArrayOfPossibleWord xmlns="http://schemas.datacontract.org/2004/07/ScrabbleSolver" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<PossibleWord><Score>12</Score><Word>���</Word></PossibleWord>
<PossibleWord><Score>9</Score><Word>�s�</Word></PossibleWord>
<PossibleWord><Score>7</Score><Word>�das</Word></PossibleWord>
<PossibleWord><Score>7</Score><Word>d�sa</Word></PossibleWord>
<PossibleWord><Score>7</Score><Word>�das</Word></PossibleWord>
</ArrayOfPossibleWord>
There are ? were there is supposed to be either å ä or ö from the swedish alphabet.
Is there a way to change encoding standards or something in flash?
What encoding does flash expect?