utf8_general_ci或utf8mb4或...? [英] Utf8_general_ci or utf8mb4 or...?

查看:360
本文介绍了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的utf32utf8mb4(以及标准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文档.

这篇关于utf8_general_ci或utf8mb4或...?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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