Welcome Guest, Not a member yet? Register   Sign In
Chinese database content within dynamic PHP pages using CodeIgniter
#1

[eluser]JoeWa[/eluser]
I'm trying to pull Chinese database content to some dynamic PHP pages within our CodeIgniter website. The PHP files that make up each page are encoded as UTF8 which displays static Chinese text correctly. However, all Chinese content from the database is rendered as question marks.

For example:
Code:
中华人民共和国
...shows up as:
Code:
???????
As with the PHP code, all tables are collated as:
Code:
utf8_general_ci


The data shows correctly in the database. Any ideas? Many thanks!
#2

[eluser]JoeWa[/eluser]
This is now sorted. Line 50 of database.php in root -> application -> config should have read:

Correct:
Code:
$db['default']['char_set'] = "UTF8"

Incorrect:
Code:
$db['default']['char_set'] = "UTF-8"

Something so simple! I hope that might help others.




Theme © iAndrew 2016 - Forum software by © MyBB