0

I am using Emoji-picker for the text area. I created a column collation utf8mb4_unicode_ci, but it saves as ?????????.

Or is there any better emoji for the text area that can save in table?

halfer
  • 19,824
  • 17
  • 99
  • 186
Rinjin Lama
  • 9
  • 1
  • 3
  • Have you tried with any other collation?.. but in any case, have you seen the actual content prior inserting it to the database? maybe you can encode it (something like base64_encode) and then you wouldn't have to worry about weird characters in the db – Benjamin Vison Jan 10 '17 at 18:35
  • thank you for your response. It works when I change my column to blob. I also change a character varaibles to utf8mb4_unicode_ci. – Rinjin Lama Jan 10 '17 at 19:00
  • What is an emojiPicker? – halfer Jan 10 '17 at 22:28
  • Possible duplicate of [How to insert utf-8 mb4 character(emoji in ios5) in mysql?](http://stackoverflow.com/questions/7814293/how-to-insert-utf-8-mb4-characteremoji-in-ios5-in-mysql) – Aᴍɪʀ Jan 10 '17 at 22:45
  • I'm using this one, https://github.com/OneSignal/emoji-picker – Rinjin Lama Jan 11 '17 at 21:08

2 Answers2

-1

I think you have pretty much found the answer by now. Changing the data-type of the column to blob was definitely on the path to finding the answer but I thought I would just like to elaborate on how to display the emojis that have been stored (well at least from php perspective).

So assuming you have all the necessary files in your current project from emojipicker, if you wanted to display the emoji in a

tag, all you need to do is to add this property <p data-emojiable= true ></p>

So here is my php example. <p data-emojiable= true>'.$row['pointText'].'</p>. pointText is a blob datatyped column from my database table where stores emoji code.I hope this makes sense. Remember to have all the neccessary files

Have a good day

-1

Yeah, BLOB will work. But to do it in TEXT,

  • The bytes to be stored are not encoded as utf8mb4. Fix this.
  • The column in the database is CHARACTER SET utf8mb4. Fix this.
  • Also, check that the connection during reading is UTF-8.

More discussion under "Question Marks" in Trouble with utf8 characters; what I see is not what I stored

Community
  • 1
  • 1
Rick James
  • 135,179
  • 13
  • 127
  • 222