Try to use utf8_unicode_ci
collation instead of utf8_general_ci
. General_ci removes vowels and other special characters and translate all of them to "A" and "U", for example:
ÀÁÅåāă = A
ü = U
utf8_unicode_ci
slower, but works with this characters as you expect.
UPDATE:
sql:
CREATE TABLE `location` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`city` varchar(120) COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
INSERT INTO `location` VALUES (1,'München');
script:
$dbh = new PDO('mysql:host=localhost;dbname=test', 'root', 'xxxxx',array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8"));
$dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$q = $dbh->prepare("SELECT * FROM `location` WHERE `city` LIKE 'münc%'");
$q->execute();
print_r($q->fetch());
And executing:
$ php catalog_mdmtointra.php
Array
(
[id] => 1
[0] => 1
[city] => München
[1] => München
)
UPDATE2:
My versions:
ii percona-server-common-5.5 5.5.33-rel31.1-566.wheezy i386 Percona Server database common files (e.g. /etc/mysql/my.cnf)
ii php5-mysqlnd 5.4.4-14+deb7u2 i386 MySQL module for php5 (Native Driver)