【发布时间】:2015-11-10 12:20:21
【问题描述】:
我有一个带有 utf8 字符集和 utf8_unicode_ci 排序规则的 mysql 架构。问题是当我想查询一些土耳其语字符时,Mysql 无法确定该字符是否为土耳其语。
在土耳其语中,“İ”是大写“i”,“I”是大写“ı”。
SELECT name FROM students where name = "testĞÇ"; //returns "testğç" which is true
SELECT name FROM students where name = "testI"; //Mysql thinks "I" character is capital "i" and returns null
我的学生表数据;
testğç
testı
编辑:我的“名称”列的排序规则是 utf8_unicode_ci。
SELECT name FROM students where name = "testI" collate utf8_turkish_ci; //still returns null
编辑 2: 当我将“名称”列的排序规则从 utf8_unicode_ci 更改为 utf8_turkish_ci 时,效果很好。但是这次我需要将所有表格列的排序规则更改为 utf8_turkish_ci,我不知道这会导致任何数据丢失。
【问题讨论】:
标签: mysql