Welcome Guest, Not a member yet? Register   Sign In
Inserting Special Characters Into Database
#1

[eluser]asciiCode[/eluser]
I have the database set as utf-8 and the code igniter config set to utf-8

However, when I go to insert this example data in to the database "aaaaöbbbb"

The aaaa is added to the database but the öbbbb is left off and lost.

What am I doing wrong and how can I fix it?

Thanks.
#2

[eluser]InsiteFX[/eluser]
You need to create the database using collation utf8_unicode_ci

Also for phpMyAdmin
After creating the database click on the operations tab at the bottom
you can change the database to the utf8_unicode_ci

InsiteFX
#3

[eluser]asciiCode[/eluser]
Thank you for your reply, I am using utf8_unicode_ci
#4

[eluser]InsiteFX[/eluser]
You needto do the phpMyAdmin above!

Even if you create the database for utf8_unicode_ci it will default
right back to latin1_swedish_ci

click on the operations tab and look at the very bottom!

InsiteFX
#5

[eluser]asciiCode[/eluser]
Under the operations tab the collation value is and has been listed as utf8_unicode_ci. Also when I look at all of the rows and all of the tables the collation value is utf8_unicode_ci.
#6

[eluser]potatoDie[/eluser]
For me, changing the settings to utf8 of the database definition itself didn't work. But leaving the database collation at latin1_swedish_ci and using this also for the CI-settings (config/database.php) worked ok:

Code:
$db['default']['dbcollat'] = "latin1_swedish_ci";

I suppose any other latin would do, but not utf8?




Theme © iAndrew 2016 - Forum software by © MyBB