0

I am struck with the insertion of emojis. The problem is MySQL saves some of the smileys, some not. I tried using the all the tricks, to make the database utf8mb4_unicode_ci, making tables the same. character sets in the config but none helped. Is there anything which I still has not tried?

Qirel
  • 25,449
  • 7
  • 45
  • 62
VishalParkash
  • 490
  • 3
  • 15
  • 2
    Collation != charset. And the entire pipeline needs to be UTF8(mb4). I have previously written [**an answer about UTF-8 encoding**](https://stackoverflow.com/a/31899827/4535200) that contains a little checklist, that will cover *most* of the charset issues in a PHP/MySQL application. There's also a more in-depth topic, [UTF-8 All the Way Through](https://stackoverflow.com/q/279170/4535200). Most likely, you'll find a solution in either one or both of these topics. – Qirel Sep 22 '17 at 16:27
  • What's the table and column character sets? – apokryfos Sep 22 '17 at 16:28
  • Make sure you have all these things using utf-8 encoding. **1-** the database table , **2-** the connection between the client(PHP script) and the database, **3-** the content-type header of the http request and finally the browser. – Accountant م Sep 22 '17 at 16:31
  • Also note that if you saved utf-8 characters in a non utf-8 table, mysql will convert them to actual question marks , no matter you will do later, you lost your text forever. – Accountant م Sep 22 '17 at 16:34
  • You must use `utf8mb4`, not `utf8` in MySQL and when connecting. See "question mark" in http://stackoverflow.com/questions/38363566/trouble-with-utf8-characters-what-i-see-is-not-what-i-stored – Rick James Sep 22 '17 at 19:16
  • Thank you all for your help, It is fixed by all your suggestions :) – VishalParkash Sep 23 '17 at 07:54

0 Answers0