|
|
|
#1 |
|
Messages: n/a
Hébergeur: |
Hello,
I have a table like this: CREATE TABLE `places` ( `name` varchar(256) collate utf8_unicode_ci NOT NULL, PRIMARY KEY (`name`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci | Then I want to insert two values: pjöngjang.com and pjongjang.com But on the second record I get this message: DBD::mysql::st execute failed: Duplicate entry 'pjongjang' for key 1 Whats wrong with it? The character set and collation set is defined as utf8, so mysql should see a difference between "ö" and "o". Regards Marten |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
Marten Lehmann napsal(a): > Hello, > > I have a table like this: > > CREATE TABLE `places` ( > `name` varchar(256) collate utf8_unicode_ci NOT NULL, > PRIMARY KEY (`name`) > ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci | > > Then I want to insert two values: > > pjöngjang.com and > pjongjang.com > > But on the second record I get this message: > > DBD::mysql::st execute failed: Duplicate entry 'pjongjang' for key 1 > > Whats wrong with it? The character set and collation set is defined as > utf8, so mysql should see a difference between "ö" and "o". > > Regards > Marten > It's not problem of charset but collation. Try to change collation to utf8_bin if it's possible. "ö" and "o" are of course stored as two different chars in utf8 but collation gives them weight for correct ordering and probably in utf8_unicode_ci collation they have same weight. HTH, Dusan |
|
![]() |
| Outils de la discussion | |
|
|