• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
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.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.