title: Conversion between UTF-8 ArrayBuffer and String
body: <p>I have an <code>ArrayBuffer</code> which contains a string encoded using UTF-8 and I can't find a standard way of converting such <code>ArrayBuffer</code> into a JS <code>String</code> (which I understand is encoded using UTF-16).</p>
  
  <p>I've seen this code in numerous places, but I fail to see how it would work with any UTF-8 code points that are longer than 1 byte.</p>
  
  <pre><code>return String.fromCharCode.apply(null, new Uint8Array(data));
  </code></pre>
  
  <p>Similarly, I can't find a standard way of converting from a <code>String</code> to a UTF-8 encoded <code>ArrayBuffer</code>.</p>