CodeIgniter Forums
Chinese database content within dynamic PHP pages using CodeIgniter - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Chinese database content within dynamic PHP pages using CodeIgniter (/showthread.php?tid=52330)



Chinese database content within dynamic PHP pages using CodeIgniter - El Forum - 06-06-2012

[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!


Chinese database content within dynamic PHP pages using CodeIgniter - El Forum - 06-07-2012

[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.