title: Node JS Detect string encoding
body: <p>How to detect string encoding in Node JS and convert the string into a valid unicode string.</p>
  
  <p>For example, how do I detect a CP437 encoded string and convert it into a valid unicode string.</p>
  
  <p>Input: ¨Quin ha enga¤ado</p>
  
  <p>Output: ¿Quién ha engañado</p>
  
  <p>I wish to dynamically detect the encoding type and convert the string into a valid unicode string. 
  Thanks in advance.</p>