0
I have an autocomplete that makes connection via ajax, but when I typed letters with accent that are even in the database the query did not return anything. Both the bank, php.ini
and the codeigniter settings (database.php
, config.php
) are setando utf-8, the files are saved with UTF-8 as well.
Autocompletes:
Ai decided to test by accessing the direct url, for the method of getLocalidadesByUf
of controller
Base.php
, and print the parameter to see how it was coming, type cameo, but when the page is submitted the value arrives as *cama%C3%A7*
class Base extends CI_Controller
{
public function getLocalidadesByUf($uf, $nome) {
echo json_encode($this->uf_model->getLocalidadesByUf($uf, $nome), JSON_UNESCAPED_UNICODE);
}
}
I’m really lost and I don’t know what to do?
Is this going to get? Could you put the code.
– rray
If you go by REST the consumer URL will look like this even the indexer has to give a UTF8 Decode at the time of the query... Send the indexer..
– Panda
@rray just made a function that queries the same data... and follow the default url of codeigniter...
class Base extends CI_Controller { public function getLocalidadesByUf($uf, $nome){
 echo json_encode($this->uf_model->getLocalidadesByUf($uf, $nome), JSON_UNESCAPED_UNICODE);
 }
– Jordani da Silva da Cruz
@Dom tou usando o padrão do codeigniter... https://github.com/bcit-ci/CodeIgniter/blob/develop/index.php
– Jordani da Silva da Cruz