I am trying to save the emojis that are being passed in the below texts message and description as below
String description="3⃣5⃣3⃣‼〽➗➗♋♍♋♍⬅⬆⬅⬅"
String message= "Hi How are you "
When I encode the description using below code, It encodes fine but the description column in database is shown as
Expert%2Chi+%F0%9F%91%8B+was+your+
and message as Hi+How+are+you
public static String encodeStringUrl(String url) {
String encodedUrl =null;
try {
encodedUrl = URLEncoder.encode(url, "UTF-8");
} catch (Exception e) {
return encodedUrl;
}
return encodedUrl;
}
I would like to know if there is any way to store the message and description in Mysql tables with the same description and message with emoticons as it will give us a chance to search properly with the String for example
Now the message "Hi How are you"(it is normal text but it can also have emojis that's why encoded) is saved as Hi+How+are+you
When I try to fetch data from db basing on message column as below I will get null data because the value is Hi+How+are+you
select * from employee where message="Hi How are you"
I have also made changes to the table
ALTER TABLE Employee CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;