mysql 中的波兰语和德语重音字母
Polish and German accented letters in mysql
我想在独特的专栏中存储抛光和德国标志。
当我更改数据库时:
alter database osa character set utf8 collate utf8_general_ci;
我对德语符号有疑问。
sql> insert into company(uuid, name) VALUE ("1","IDE")
[2016-11-27 10:37:35] 1 row affected in 13ms
sql> insert into company(uuid, name) VALUE ("2","IDĘ")
[2016-11-27 10:37:37] 1 row affected in 9ms
sql> insert into company(uuid, name) VALUE ("3","Schuring")
[2016-11-27 10:37:38] 1 row affected in 13ms
sql> insert into company(uuid, name) VALUE ("4","Schüring")
[2016-11-27 10:37:39] [23000][1062] Duplicate entry 'Schüring' for key 'UK_niu8sfil2gxywcru9ah3r4ec5'
我必须使用哪种整理?
编辑:
也不适用于 utf8_unicode_ci
将所有出现的 utf8_general_ci
替换为 utf8_unicode_ci
。 utf8_general_ci
坏了,显然:What are the diffrences between utf8_general_ci and utf8_unicode_ci?
utf8_general_ci
is a very simple — and on Unicode, very broken — collation, one that gives incorrect results on general Unicode text.
也许你应该试试 utf8mb4_unicode_ci ?
utf8 字符集无法存储所有 utf8 字符。
https://dev.mysql.com/doc/refman/5.5/en/charset-unicode-utf8mb4.html
alter database osa character set utf8mb4 COLLATE utf8mb4_bin;
适合我。 @Maciek Bryński 谢谢你的提示。
COLLATION
中的_ci
表示"character insensitive"。不幸的是,它也意味着 "accent insensitive"。因此,要使 E
和 Ę
得到不同的对待,您需要 _bin
归类——utf8_bin
或 utf8mb4_bin
.
mb4
需要Emoji和中文,加上一些晦涩的东西。
我想在独特的专栏中存储抛光和德国标志。 当我更改数据库时:
alter database osa character set utf8 collate utf8_general_ci;
我对德语符号有疑问。
sql> insert into company(uuid, name) VALUE ("1","IDE")
[2016-11-27 10:37:35] 1 row affected in 13ms
sql> insert into company(uuid, name) VALUE ("2","IDĘ")
[2016-11-27 10:37:37] 1 row affected in 9ms
sql> insert into company(uuid, name) VALUE ("3","Schuring")
[2016-11-27 10:37:38] 1 row affected in 13ms
sql> insert into company(uuid, name) VALUE ("4","Schüring")
[2016-11-27 10:37:39] [23000][1062] Duplicate entry 'Schüring' for key 'UK_niu8sfil2gxywcru9ah3r4ec5'
我必须使用哪种整理?
编辑:
也不适用于 utf8_unicode_ci
将所有出现的 utf8_general_ci
替换为 utf8_unicode_ci
。 utf8_general_ci
坏了,显然:What are the diffrences between utf8_general_ci and utf8_unicode_ci?
utf8_general_ci
is a very simple — and on Unicode, very broken — collation, one that gives incorrect results on general Unicode text.
也许你应该试试 utf8mb4_unicode_ci ?
utf8 字符集无法存储所有 utf8 字符。
https://dev.mysql.com/doc/refman/5.5/en/charset-unicode-utf8mb4.html
alter database osa character set utf8mb4 COLLATE utf8mb4_bin;
适合我。 @Maciek Bryński 谢谢你的提示。
COLLATION
中的_ci
表示"character insensitive"。不幸的是,它也意味着 "accent insensitive"。因此,要使 E
和 Ę
得到不同的对待,您需要 _bin
归类——utf8_bin
或 utf8mb4_bin
.
mb4
需要Emoji和中文,加上一些晦涩的东西。