When to use utf-8 and when to use latin1 in MySQL?

后端 未结 8 1690
暖寄归人
暖寄归人 2021-02-13 21:56

I know that MySQL has default of latin1 encoding and apparently it takes 1 byte to store a character in latin1 and 3 bytes to store a character in

8条回答
  •  夕颜
    夕颜 (楼主)
    2021-02-13 22:17

    I am not an expert, but I always understood that UTF-8 is actually a 4-byte wide encoding set, not 3. And as I understand it, the MySQL implementation of utf8_unicode_ci only handles a 3-byte wide encoding set...

    If you want the full UTF-8 4-byte character encoding, you need to use utf8mb4_unicode_ci encoding for your MySQL database/tables.

提交回复
热议问题