Encoding problem in Codeigniter

Asked

Viewed 103 times

0

I use Postgres as a database and my table is set as UTF8.

ENCODING = 'SQL_ASCII'
LC_COLLATE = 'en_US.UTF-8'
LC_CTYPE = 'en_US.UTF-8'

But when I make an appointment he returns to me like this.

erro enconding

I’m only doing one get at the bank.

public function get_usuario_tipo()
{
 return $this->db->get('usuario_tipo')->result_object();
}

And you’re returning me with the wrong accents.

My DB config is set as follows.

 'char_set'     => 'latin1',
 'dbcollat'     => 'utf8_general_ci',

1 answer

1

I was able to solve using.

utf8_encode

But I don’t think it’s the best solution.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.