Welcome Guest, Not a member yet? Register   Sign In
UTF-8 chars not displaying correctly
#1

[eluser]gullah[/eluser]
I have my database set up to accept utf-8 chars and it does, it shows the accent marks above items in phpmyadmin. It seems to be working fine in phpmyadmin. But when I go to display those rows in CI i don't get the correct characters. Instead, I get chars like é. Any ideas?
#2

[eluser]pistolPete[/eluser]
Did you setup the database in CI using:
Code:
$db['default']['char_set'] = "utf8";
$db['default']['dbcollat'] = "utf8_general_ci";

Does your page html <head> contain:
Code:
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
#3

[eluser]gullah[/eluser]
i guess my meta content-type was messed up.

Thanks!
#4

[eluser]metamorpher[/eluser]
I have everything on ISO-8859-1 'cause my native language is spanish...

I have my config file with this charset, and my db is like this

Code:
$db['default']['char_set'] = "iso-8859-1";
$db['default']['dbcollat'] = "latin1_general_ci";

AND
<meta http-equiv="Content-type" content="text/html; charset=iso-8859-1" />

what's wrong with it? because when I want to show my data it gives away chars like Campañas (bolded char should've been a Ñ)

I think I've tried everything, but I don't want to appendix on every line PHP function utf8_decode...
#5

[eluser]metamorpher[/eluser]
and when I insert stuff on my database via input form, it just stores questions marks instead of the special chars...


btw: using
Code:
$this->input->post('field');
#6

[eluser]metamorpher[/eluser]
got solved... just restarted my server and got well...




Theme © iAndrew 2016 - Forum software by © MyBB