The reason you don't see the problem with Ajax, is because javascript encoding is UTF-8. This is not the case with PHP, so you should add this to your php.
header('Content-Type: text/html; charset=utf-8');
Question
I have problem with showing utf8_general_ci characters. I've set all my tables and columns to utf8 but all non-english alphabet characters dont show (they do but encrypted like this Å¡Äćžđ). Also signs like ' + etc. don't show up. I am running my website on Bluehost.
What is confusing me, is that I use AJAX on my website. When I call AJAX files characters show normaly, but when loaded in non-ajax pages I have an error, I told you about.
Solution 2
The reason you don't see the problem with Ajax, is because javascript encoding is UTF-8. This is not the case with PHP, so you should add this to your php.
header('Content-Type: text/html; charset=utf-8');
OTHER TIPS
First, you have to know where a charset is used:
collation/charset
in MySQL)Content-Type:
header + <meta>
-tag)SET NAMES 'utf8';
be your first query)I think that you have wrong encoded data in a correct encoded field, so make sure your data is even UTF-8 before you put it into the database, e.g the page where your form is etc.
Make sure your browser interprets it as UTF-8. Do this with the help of the meta-tags in HTML.
Example:
<head>
<meta charset="utf-8">
</head>