É vs. E in MySQL database

与世无争的帅哥 提交于 2020-01-06 02:57:26

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!