utf8_general_ci或utf8mb4或...?
utf16或utf32?我正在尝试以多种语言存储内容.一些语言使用双倍宽度的字体(例如,日语字体通常是英语字体的两倍).我不确定应该使用哪种数据库.关于这四个字符集之间差异的任何信息...
utf16 or utf32? I'm trying to store content in a lot of languages. Some of the languages use double-wide fonts (for example, Japanese fonts are frequently twice as wide as English fonts). I'm not sure which kind of database I should be using. Any information about the differences between these four charsets...
MySQL的utf32
和utf8mb4
(以及标准UTF-8)可以直接存储Unicode指定的任何字符;前者是固定大小,每个字符4个字节,而后者是每个字符1-4个字节.
MySQL's utf32
and utf8mb4
(as well as standard UTF-8) can directly store any character specified by Unicode; the former is fixed size at 4 bytes per character whereas the latter is between 1 and 4 bytes per character.
utf8mb3
和原始的utf8
只能存储前65,536个代码点,这些代码点将覆盖CJVK(中文,日文,越南文,韩文),每个字符使用1至3个字节.
utf8mb3
and the original utf8
can only store the first 65,536 codepoints, which will cover CJVK (Chinese, Japanese, Vietnam, Korean), and use 1 to 3 bytes per character.
utf16
在前65,536个代码点中使用2个字节,在所有其他地方使用4个字节.
utf16
uses 2 bytes for the first 65,536 codepoints, and 4 bytes for everything else.
对于字体,这完全是视觉上的事情.
As for fonts, that's strictly a visual thing.
绝对最低限度,每个软件开发人员都必须绝对肯定地了解Unicode和字符集(没有任何借口) !)"
另请参见有关Unicode支持的MySQL文档.