Mysql utf8和utf8mb4的区别 The character set named utf8 uses a maximum of three bytes per character and contains only BMP characters. As of MySQL 5.5.3, the utf8mb4 character set uses a maximum of four bytes per character supports supplementary characters: For a BMP character, utf8 and utf8mb4 have identical storage characteristics: same code values, same encoding, same length. For a supplementary character, utf8 cannot store the character at all, whereas utf8mb4 requires four bytes to store it. Because utf8 cannot store the character at all, you have no supplementary characters in utf8 columns and need not worry about converting characters or losing data when upgrading utf8 data from older versions of MySQL. 上面是Mysql官网对utf8mb4的描述,总结来说为utf8的字符集每个字符最多使用三个字节,并且只包含BMP(Unicode基本多文种平面。关于Unicode的知识,推荐大家去看维基百科,理解17个平面是什么意思)字符。 从MySQL 5.5.3开始,utf8mb4字符集每个字符最多使用4个字节,支持补充字符。
总结来说Emoji对应的Unicode编码不在utf8对应的Unicode分组平面内,无法直接用Mysql的utf8存储Emoji编码格式字符。
腾讯云数据库 SQL Server (TencentDB for SQL Server)是业界最常用的商用数据库之一,对基于 Windows 架构的应用程序具有完美的支持。TencentDB for SQL Server 拥有微软正版授权,可持续为用户提供最新的功能,避免未授权使用软件的风险。具有即开即用、稳定可靠、安全运行、弹性扩缩等特点。