How to store Emoji Character in MySQL Database

后端 未结 16 2007
迷失自我
迷失自我 2020-11-22 05:34

I am using Emoji character in my project. That characters are saved (??) into mysql database. I had used database Default collation in utf8mb4_general_ci. It sh

16条回答
  •  粉色の甜心
    2020-11-22 06:37

    The simplest solution what works for me is to store the data as json_encode.

    later when you retrieve just make sure you json_decode it.

    Here you don't have to change the collation or the character set of the database and the table.

提交回复
热议问题