Referred to this question: Emoji crashed when uploading to Big Query
I'm looking for the best and clean way to encode emojis from this \ud83d\ude04 type to this one (Unicode) - \U0001f604 because currently, I do not have any idea except create python method which will pass through a text file and replace emoji coding.
This is the string can be converted:
Converting emojis to Unicode and vice versa in python 3
As an assumption, maybe need to pass through text line by line and convert it??
Potential Idea:
with open(ff_name, 'rb') as source_file:
with open(target_file_name, 'w+b') as dest_file:
contents = source_file.read()
dest_file.write(contents.decode('utf-16').encode('utf-8'))