I have problems reading signs 'č', 'ć', 'đ', 'š', 'ž' from MySQL database.
I have tried few suggestions that I found on the internet, but none worked. I am looking for correct combination of charset in the database and in PHP file. So far I have always used UTF.
Use SET CHARACTER SET 'utf8'
before querying any data.
http://dev.mysql.com/doc/refman/5.0/en/charset-connection.html
Set table and db charset, collation, etc. to utf8_general_ci
After establishing connection from php, be sure to do SET NAMES UTF8
. That step is very important.
Make sure you saved all PHP files using utf-8 encoding (that was common cause several years ago)
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
I'm from Slovenia, where we use these 'special chars', and believe me, this is our everyday problem ;)
Try to do this before reading
SET character_set_client='utf8'
SET character_set_results='utf8'
SET collation_connection='utf8_general_ci'
You can add simply in your PHP (in Writting and Reading):
$con = mysqli_connect(...);
mysqli_set_charset($con,"utf8");
After having your table set as ut8 for default charset.