问题
MySQL thinks É and E are the same and thus throw an exception saying Duplicate entry 'CLEME' for key 'PRIMARY'
MySQL is 5.1.30 and the table uses utf8-unicode-ci and the field is defined as follows:
search_key
varchar(120) CHARACTER SET latin1 NOT NULL,
Is there a way to let this field know they are not the same?
Thanks!
回答1:
Change the character set of the field to UTF-8 as well. Also, set the connection character set to UTF-8 when you do the insert.
来源:https://stackoverflow.com/questions/4110295/%c3%89-vs-e-in-mysql-database