I have stored Swedish words in MysQL database. The encoding of the table is
utf8_unicode_ci
I also tried
utf8_swedish_ci
when I'm doing a search in database, 'a' and 'ä' are treated the same. So the results include both words that begin with a and ä. This is true vice-versa as well. My application is developed with CakePHP and I have the following in my core.php
Configure::write('App.encoding', 'UTF-8');
Am I missing anything here?
This is my query:
$term = $this->request->query['term'];
$this->loadModel('Words');
$condition = array('word LIKE' => trim($term) . '%', 'is_active' => true);
$words = $this->Words->find('list', array(
'fields' => array('word'),
'limit' => 7,
'conditions' => $condition));
return $this->respond($words, true);
I use to for Jquery autocomplete:
$(function () {
$("#tags").autocomplete({
source: 'autocomplete'
});
});