title: Encoding emoji in Erlang
body: <p>Assuming I have a binary</p>
  
  <pre><code>Message = &lt;&lt;"string containing emoji"&gt;&gt;.
  </code></pre>
  
  <p>How do I properly encode it in Unicode? I tried doing:</p>
  
  <pre><code>Encoded = &lt;&lt;Message/utf16&gt;&gt;.
  </code></pre>
  
  <p>I get this warning when compiling the file:</p>
  
  <blockquote>
    <p>Warning: binary construction will fail with a 'badarg' exception
    (invalid Unicode code point in a utf8/utf16/utf32 segment)</p>
  </blockquote>
  
  <p>I tried this with /utf8 as well. Same warning.</p>