Hi,

I'am having a bit of a problem with special chars in a getJSON
response which is the result from php and smarty

the file called by the getJSON is something like this:
<?php
   $callback = $_REQUEST["callback"];
   {...}
      Getting data from a wsdl using nusoap.
   {...}
   $smarty = new Smarty;
   $smarty->compile_check = true;
   $smarty->debugging = false;
   $smarty->template_dir = $CFG->smartydirs . "/templates";
   $smarty->compile_dir = $CFG->smartydirs . "/templates_c";
   $smarty->config_dir = $CFG->smartydirs . "/configs";
   {...}
      assigning vars etc...
   {...}
   $html = $smarty->fetch("alojamentos/resultadoPesquisa.tpl");

   $resposta = array(
      "html"=>utf8_encode($html)
   );

   echo $callback . '('. json_encode($resposta) . ')';
?>

some of the vars and text used in the smarty output as accents,
ceddils, etc the problem is when i replace a div's innerHTML for the
one on json.html those special chars appear like squares or chinese
chars.
how can this be fixed?

Reply via email to