title: Convert Facebook json file sequences like \u00f0\u009f\u0098\u008a to emoji characters
body: <p>I have downloaded my Facebook data as json files. The json files for my posts contain emojis, which appear something like this in the json file: \u00f0\u009f\u0098\u008a. I want to parse this json file and extract the posts with the correct emojis. </p>
  
  <p>I can't find a way to load this json file into a json object (using JavaScript) then read (and output) the post with the correct emojis.  </p>
  
  <p>(Eventually I will upload these posts to WordPress using its REST API, which I've worked out how to do.)</p>
  
  <p>My program is written in JavaScript and run using nodejs from the command line. I've parsed the file using:</p>
  
  <pre><code>const fs = require('fs')
  let filetext = fs.readFileSync(filename, 'utf8')
  let jsonObj = JSON.parse(filetext)
  </code></pre>
  
  <p>However, when I output the data (using something like <code>jsonObj.status_updates.data[0].post</code>), I get strange characters for the emoji, like <code>Happy birthday ├░┬ƒ┬ÿ┬è</code> instead of <code>Happy birthday </code>. This is not a Windows 10 console display issue because I've piped the output to a file also.</p>
  
  <p>I've used the answer <a href="https://stackoverflow.com/questions/50826787/decode-or-unescape-u00f0-u009f-u0091-u008d-to">Decode or unescape \u00f0\u009f\u0091\u008d to &#128077;</a> to change the \uXXXX sequences in the json file to actual emojis before parsing the file. However, then <code>JSON.parse</code> does not work. It gives this message:</p>
  
  <pre><code>SyntaxError: Unexpected token o in JSON at position 1
      at JSON.parse (&lt;anonymous&gt;)
  </code></pre>
  
  <p>So I'm in a bind: if I convert the \uXXXX sequences before trying to parse the json file, the JavaScript json parser has an error. If I don't convert the \uXXXX sequences then the parsed file in the form of a json object does not provide the correct emojis!</p>
  
  <p>How can I correctly extract data, including emojis, from the json file?</p>