title: Best and clean way to Encode Emojis (Python) from text file
body: <p>Referred to this question: <a href="https://stackoverflow.com/questions/52169443/emoji-crashed-when-uploading-to-big-query/52173847?noredirect=1#comment91308331_52173847">Emoji crashed when uploading to Big Query</a></p>
  
  <p>I'm looking for the best and clean way to encode emojis from this <code>\ud83d\ude04</code> type to this one (Unicode) - <code>\U0001f604</code> because currently, I do not have any idea except create python method which will pass through a text file and replace emoji coding.</p>
  
  <p><strong>This is the string can be converted:</strong></p>
  
  <p><a href="https://stackoverflow.com/questions/47716217/converting-emojis-to-unicode-and-vice-versa-in-python-3">Converting emojis to Unicode and vice versa in python 3</a></p>
  
  <p>As an assumption, maybe need to pass through text line by line and convert it??</p>
  
  <p><strong>Potential Idea:</strong></p>
  
  <pre><code>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'))
  </code></pre>