How to search for special characters, unicode characters and Emoji's in a mysql Database

谁说我不能喝 提交于 2020-01-06 08:37:30

问题


I am saving Emoji's with charset utfmb4_general_ci, Storing and retrieving are working fine but when i try to search for the information with a string containing Emoji's or special characters i am not getting the result. It always returning empty.

Can somebody help to solve this?

CODE

select * from table where Title LIKE '%Kanye West - \"Bound 2\" PARODY%'

UPDATE:

The search string are like

  1. Kanye%20West%20-%20"Bound%202"%20PARODY

    Stored in database like Kanye West - \"Bound 2\" PARODY

  2. Family%20guy%20😎😔😁

    Stored in database like Family guy \ud83d\ude0e\ud83d\ude14\ud83d\ude01

Please accept my Apologies for not making it clear

The first string is What we sent from the url via HTTP POST and the second is how the data is stored in my table.

The charset of the database table is

utf8mb4_general_ci

来源:https://stackoverflow.com/questions/21546842/how-to-search-for-special-characters-unicode-characters-and-emojis-in-a-mysql

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!