title: Node.js encode ISO8859-1 to UTF-8
body: <p>I have an application that allows users to persist strings to a database and those strings may contain emojis. The problem I have is an emoji such as <code></code> will get stored in MySQL as <code>ðŸ˜Š</code> </p>
  
  <p>When I retrieve this string using a PHP MySQL client and render it in a web browser, it renders fine probably because the <code>Content-Type</code> is set to UTF-8. When I try to read the string in node.js, I get back what I think is the ISO8859-1 encoding a literal <code>ðŸ˜Š</code>. The charset on the table is set to <code>latin1</code> and that's where I'm getting ISO8859-1 from. </p>
  
  <p>What's the right way to encode the string in node.js so that I can see the emoji and not the encoding set by MySQL when I <code>console.log</code> the string?</p>