Click here to Skip to main content
15,867,568 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi, I have a CSV file containing tweets with emojis (eg. "Cool! 💕") and I need to import them into a MySQL table in such a way they will be saved/displayed correctly...
What do I have to set up and how for a correct import (I mean collation, etc.)?

More details:

- In the CSV file, the emoji are visible
- The encoding of the CSV file is UTF-8
- I am on Windows 11

What I have tried:

- To set the character set to utf8mb4 and collation to utf8mb4_unicode_ci in the table
- To add " SET NAMES 'utf8mb4';" (also tried with Latin1) before the LOAD query
Posted
Updated 11-Feb-23 0:42am
Comments
Graeme_Grant 11-Feb-23 6:40am    
moved

1 solution

Here is a list of the EMOJI codes: Full Emoji List, v15.0[^]

Here is one solution: How to store Emoji Character in MySQL Database - StackOverflow[^]
 
Share this answer
 
v3
Comments
diadon2 11-Feb-23 6:44am    
I have no control over the emojis in the CSV file, they are the standard ones of twitter.
Graeme_Grant 11-Feb-23 6:55am    
Twitter do not generate CSV files, so the CSV file could have been stored incorrectly.
diadon2 12-Feb-23 5:31am    
I do not know, it has been generated by python and if I open it with Notepad++ they are correctly visible (UTF-8 encoding).
Graeme_Grant 12-Feb-23 5:59am    
If they are correct UTF8, then there should be no issue.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900