It seems this is one of the oldest issues of PHP develoment, right?. I’ve developed a PHP website, based on codeigniter framework (and a mysql database), and i ran into a lot of problems with the ñ, not showing up well in google.
Here’s what i’ve done to fix this problem:
- Set the database collation / columns to utf8_general_ci (by means of phpmyadmin).
- In codeigniter’s ‘config.php’ file.
[cc lang=”php”]$config[‘charset’] = ‘UTF-8’;[/cc] - In codeigniter’s ‘database.php’:
[cc lang=”php”]$db[‘default’][‘char_set’] = ‘utf8’;
$db[‘default’][‘dbcollat’] = ‘utf8_general_ci’;[/cc] - In the ‘general’ html-rendering, before anything else gets echo’ed (beware, i’m using HTML5.. HTML4 is different):
[cc lang=”html”][/cc] - And finally… in my .htaccess file:
[cc lang=”bash”]AddDefaultCharset UTF-8[/cc]
I hope this helps. I’ve spent many hours reading… testing… and a couple days waiting for Google’s update!.