什么是德语最好的 MySQL 排序规则 [英] What is the best MySQL collation for German language

查看:35
本文介绍了什么是德语最好的 MySQL 排序规则的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在建立一个德语网站,所以我将使用ä, ü, ß 等字符,那么您有什么建议?

I am building a web site in German language, So I will be using characters like ä, ü, ß etc., So what are your recommendations?

推荐答案

这个答案已经过时了.如需完整的表情符号支持,请参阅此答案.

作为字符集,如果可以,肯定是UTF-8.

As the character set, if you can, definitely UTF-8.

作为排序规则 - 对于具有特殊字符的语言来说有点讨厌.有多种类型的排序规则.它们都可以存储所有变音符号和其他字符,但它们在比较中对待变音符号的方式有所不同,即是否

As the collation - that's a bit nasty for languages with special characters. There are various types of collations. They can all store all Umlauts and other characters, but they differ in how they treat Umlauts in comparisons, i.e. whether

u = ü 

是真还是假;和排序(在字母表中,元音字母在排序中的位置).

is true or false; and in sorting (where in the alphabets the Umlauts are located in the sorting order).

长话短说,你最好的选择是

To make a long story short, your best bet is either

utf8_unicode_ci

它允许不区分大小写的搜索;它将 ß 视为 ss 并使用 DIN-1 排序.可悲的是,像所有非二进制 Unicode 排序规则一样,它处理 u = ü 这是一个可怕的麻烦,因为搜索Muller"也会返回Müller".您必须通过实时设置变音感知归类来解决这个问题.

It allows case insensitive searches; It treats ß as ss and uses DIN-1 sorting. Sadly, like all non-binary Unicode collations, it treats u = ü which is a terrible nuisance because a search for "Muller" will also return "Müller". You will have to work around that by setting a Umlaut-aware collation in real time.

utf8_bin

此排序规则不存在 u = ü 问题,但只能进行区分大小写的搜索.

This collation does not have the u = ü problem but only case sensitive searches are possible.

我不完全确定使用二进制排序规则是否有任何其他副作用;我在这里问了一个问题.

I'm not entirely sure whether there are any other side effects to using the binary collation; I asked a question about that here.

这个 mySQL 手册页很好地概述了各种排序规则及其在日常使用中带来的后果.

This mySQL manual page gives a good overview over the various collations and the consequences they bring in everyday use.

这里是关于mySQL 中可用的排序规则.

Here is a general overview on available collations in mySQL.

这篇关于什么是德语最好的 MySQL 排序规则的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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