17 Replies Latest reply on Feb 16, 2009 2:06 PM by flexstone

    Charset problem

    jjaparicio
      Hi
      I'm trying to send variables from FLEX to a script using URLRequest and URLVariables.
      The problem is, variables containing special characters like ç or ã, are not received properly in the script.
      here is my code:

      private function iniciaPesquisa():void {
      if (termoPesquisa.text != "Pesquisa" && termoPesquisa.text != ""){
      var url:String = "index.pl";
      var variables:URLVariables = new URLVariables();
      variables.p =2;
      variables.jjca="1";
      variables.pesquisapor=termoPesquisa.text;
      variables.pesquisaem=1;
      var request:URLRequest = new URLRequest(url);
      request.contentType="text/html; charset=utf-8";
      request.requestHeaders.push(new URLRequestHeader("Content-Type", "text/xml;charset=utf-8"));

      request.method=URLRequestMethod.GET;
      request.data = variables;
      try {
      navigateToURL(request,"_self");
      }
      catch (e:Error) {
      }
      }
      }

      Any help will be appreciated