在mysql中搜索带有变音符号的阿拉伯语单词

2021-11-17 00:00:00 arabic mysql

为了让我的问题变得简单,任何人都知道为什么这个查询返回 true

to make my question simple anyone knows why this query returns true

SELECT 'الجنة' ='الْجِنَّةِ' COLLATE utf8_unicode_ci ;

虽然此查询返回 false

while this query returns false

SELECT 'الجنة' LIKE '%الْجِنَّةِ%' COLLATE utf8_unicode_ci ;

我怎么能让后者返回 true ?谢谢.

and how could I let the later returns true ? thanks .

推荐答案

这里我修改了 AllInOne 的 sqlfiddle 使其工作:http://sqlfiddle.com/#!2/4a7004/3
NATURAL LANGUAGE MODE 更改为 BOOLEAN MODE
并将 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci 添加到数据库结构中.

here the sqlfiddle of AllInOne that I modified to make it work : http://sqlfiddle.com/#!2/4a7004/3
changed NATURAL LANGUAGE MODE to BOOLEAN MODE
and added DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci to the db structure .

相关文章