mysql 设置名称 utf8 , "pokemon"和 "pokémon"实际上相等吗?

标签 mysql utf-8 character-encoding

我测试mysql命令行,有一个问题让我困惑

set names utf8;

select STRCMP('pokemon','pokémon');

结果为零

STRCMP('pokemon','pokémon')
0

我希望它显示 -1 或 1 或其他内容

我尝试了“设置名称latin1”,它表明它们不相等。

set names latin1;
select STRCMP('pokemon','pokémon');

结果是1

STRCMP('pokemon','pokémon')
1

有什么问题吗?我可以得到像 utf8 中的 latin1 这样的结果吗?

最佳答案

 In all of these collations you will find that 'e' = 'ê'.
 utf8_czech_ci
 utf8_danish_ci
 utf8_esperanto_ci
 utf8_estonian_ci
 utf8_general_ci
 utf8_hungarian_ci
 utf8_icelandic_ci
 utf8_latvian_ci
 utf8_lithuanian_ci
 utf8_persian_ci
 utf8_polish_ci
 utf8_roman_ci
 utf8_romanian_ci
 utf8_sinhala_ci
 utf8_slovak_ci
 utf8_slovenian_ci
 utf8_spanish_ci
 utf8_spanish2_ci
 utf8_swedish_ci
 utf8_turkish_ci
 utf8_unicode_ci

关于mysql 设置名称 utf8 , "pokemon"和 "pokémon"实际上相等吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47750828/

相关文章:

c# - 在c#中编码和解码安全吗?

utf-8 - UTF-8 直接存储代码点的基本原理是什么?

mysql - 替换mysql中的垃圾字符

mysql - 根据mysql查询中的列值过滤行

php - 如何实现搜索2个不同的表数据?

swift 3 : Encode String to UTF-16LE

c++ - wchar_t 究竟能代表什么?

php - 根据ID显示所有字段

php - 根据ACF关系字段显示 "Related Posts"

python - 使用python从列表中删除不需要的数据