mysql_set_charset('utf8', $kontaktmySQL);I have been trying to figure this one out for a day no, and I am getting nowhere..
I am trying to set up a simple php calendar with mysql connection, but when I load the content from my database I get small black squares with questionsmark in them. This has to do with the charset properties, but I have tried and tried and tried different solutions and I cant get it to read properly.
I have set the mysql database to use utf8_unicode (both database and tables), I have set my codeprogrammer to save my files in utf8, I have set my charset in my header (), and I even have tried to set my mysql charset after connecting to the database, but before loading the content (mysql_set_charset('utf8',$kontaktmySQLs);). I tried to find the default charset in my apache config file, but I had no luck whith that.
I have restarted xampp and nothing changed.
My system is running on a mac osx, and I have xampp installed. I am using Coda2 to program and firefox as browser. I am from norway, I need my special characters..:)
Does anyone have a clear idea of how to fix this? I am going mental..
EDIT:
I worked it out, doing the following:
I had allreday set my header to:
<meta http-equiv="Content-type" content="text/html; charset=UTF-8" />
so I didnt have to do anything there.Use this line:
mysql_set_charset('utf8', .......);
in my database connection script, right after connecting to mySQL, but before connecting to the database.Delete and create my database all over, this time being sure to set the collation to:
utf8_unicode_ci
both for the database and the tables.
Thanks for helping!!