Welcome Guest, Not a member yet? Register   Sign In
MySQL latin1 to UTF8 site
#6

(This post was last modified: 12-14-2014, 07:06 AM by miko91. Edit Reason: Add a config )

Hello guys,

After hours and some stupid changes I got the solution.

Because of stackoverflow threads I tried to modify the charset of the DB. I also tried to use some utf8_encode() in my views.

The good way is :

header view
PHP Code:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> 

config.php
PHP Code:
$config['charset'] = 'UTF-8'

database.php
PHP Code:
$db['default']['char_set'] = "iso-8859-1"// or latin1
$db['default']['dbcollat'] = "latin1_general_ci"// or latin1_swedish_ci 

Finally, with the default configuration of CI, I've to change database.php.
And I don't need any PHP function like utf8_encode() or some others to correctly display my datas.

I thank you for your fast answers !

Once again, sorry for the english, I'm french and continue to learn.

Edit: I set my database charset to latin1.
Reply


Messages In This Thread
MySQL latin1 to UTF8 site - by miko91 - 12-13-2014, 05:33 PM
RE: MySQL latin1 to UTF8 site - by includebeer - 12-13-2014, 06:03 PM
RE: MySQL latin1 to UTF8 site - by miko91 - 12-13-2014, 06:53 PM
RE: MySQL latin1 to UTF8 site - by Rufnex - 12-14-2014, 02:34 AM
RE: MySQL latin1 to UTF8 site - by includebeer - 12-14-2014, 04:53 AM
RE: MySQL latin1 to UTF8 site - by miko91 - 12-14-2014, 07:01 AM
RE: MySQL latin1 to UTF8 site - by includebeer - 12-14-2014, 07:47 AM
RE: MySQL latin1 to UTF8 site - by Rufnex - 12-14-2014, 07:19 AM



Theme © iAndrew 2016 - Forum software by © MyBB