I have problem with encoding in jQueryUI Autocomplete. Server side application is PHP and send reply for this query with headers:
Content-Type: application/json, charset=UTF-8
Here is autocomplete code:
$('#city').autocomplete({
source: 'ajax_get_cities.html',
dataType: "json",
minLength:3
});
When I type: kra (expected result is: Kraków) I get reply (copied from Firebug raw reply):
[{"city":"Krak\u00f3w"}]
and autocomplete doesn't display this result.
Database table, field, connection, PHP file, all is UTF-8.
Where is problem?
Update
This is server side problem, PHP application based on KohanaPHP 2.3.4 framework.
Here is code to get and display result:
header('Content-Type: application/json, charset=UTF-8');
$mModel = new Partners_Model();
$str = $this->input->get('term', true);
$aCities = $mModel->getCitiesAjax($str);
echo json_encode($aCities);
When I disply $aCities array then I get correct string.