a-sak
a-sak

Reputation: 1340

accented/non-accented characters in mySQL's varchar

Does mySQL treat accented and non-accented character as the same. For example "é" is same as "e" ?

From the following simple test it looks like it.

mysql> CREATE TABLE `ct` (`eid` varchar(255) NOT NULL, PRIMARY KEY (`eid`)) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
Query OK, 0 rows affected (0.13 sec)

mysql> insert into ct values ('décor');
Query OK, 1 row affected (0.01 sec)

mysql> insert into ct values ('decor');
ERROR 1062 (23000): Duplicate entry 'decor' for key 'PRIMARY'

For my application 'décor' and 'decor' are 2 different values. Can someone help me get around it?

Any help will be useful.

Thanks in advance.

Upvotes: 1

Views: 894

Answers (1)

PhiLho
PhiLho

Reputation: 41162

It depends on the charset and the collation you have defined for your base and your tables.

Upvotes: 1

Related Questions