</div>
</div>
<div class="grid--cell mb0 mt4">
<a href="/questions/279170/utf-8-all-the-way-through" dir="ltr">UTF-8 all the way through</a>
<span class="question-originals-answer-count">
(15 answers)
</span>
</div>
<div class="grid--cell mb0 mt8">Closed <span title="2019-05-12 11:20:37Z" class="relativetime">12 months ago</span>.</div>
</div>
</aside>
I'm using ajax to get my results from my query. The ajax gives the response (sql query executes successfully) but some characters (croatian language) are broken, hence utf-8 doesn't function correctly.
In my php script, I've tried the following:
$con->set_charset('utf8');
OR
$con->query("SET NAMES 'utf8'");
I've also added the following line in the header:
header('Content-Type: text/html; charset=utf-8');
as well as the content type in my client-ajax code:
contentType: "application/json; charset=utf-8"
Still my characters break, I'm not getting utf-8 valid response. In phpMyAdmin I've got the utf8_general_ci collation which I believe is ok.
</div>