哪个MySQL排序规则比较例如é和e相等? [英] Which MySQL collation compares e.g. é and e as equal?

查看:135
本文介绍了哪个MySQL排序规则比较例如é和e相等?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果不存在这样的排序规则,如果MySQL具有将字符串转换为ASCII等价物的功能,则可以解决该问题. FUNC('Være')='Vaere'-可能有几个这样的功能,每个字母一个,这很麻烦,但是如果有效的话可以接受.

if no such collation exists, I can work around it if MySQL has a function which will convert strings into ASCII equivalents e.g. FUNC('Være')='Vaere' -- there might be several such functions, one for each alphabet, which would be a hassle but acceptable if effective.

我需要一个MySQL5排序规则,它将把带重音符号的字符进行比较,而与带重音无关.例如fêter"应被视为等于"feter",而eł"应与"el"匹配

I need a MySQL5 collation which will compare accented characters as equivalent, irrespective of accents. e.g. "fêter" should be considered equal to "feter" and "eł" should match "el"

理想情况下,这不仅限于单字符替换,例如应将"For AtVæreSom ManBør"等同于"For At Vaere Som Man Bor". WHERE name LIKE '%ere%'也应该匹配它.

Ideally this wouldn't be limited to single-character substitutions, e.g. "For At Være Som Man Bør" should be considered equal to "For At Vaere Som Man Bor". WHERE name LIKE '%ere%' should also match it.

我看到有西班牙语/波兰语/等等的排序规则,但我需要一个排序规则来覆盖所有类似于拉丁语的字母(而不是阿拉伯或亚洲字母等).字符串存储为UTF-8.

I see there are collations for spanish/polish/etc, but I need one collation to cover all latin-like alphabets (not Arabic or Asian ones etc). The strings are stored as UTF-8.

我应该使用哪个排序规则?

Which collation should I use?

推荐答案

由于您说的是使用utf8字符集,因此,原始问题的答案是除utf8_bin以外的所有字符".

Since you said you're using the utf8 characters set, the answer to your original question is "all of them except utf8_bin".

在所有这些归类中,您会发现'e'='ê'.

In all of these collations you will find that 'e' = 'ê'.

但是,我不知道'æ'='ae'或'ø'='o'的任何归类.

However, I don't know of any collations where 'æ' = 'ae' or 'ø' = 'o'.

 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排序规则比较例如é和e相等?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆