title: PHP converting utf-16 to ascii
body: <p>I'm trying to convert some encoded text to display on a website; the specific example is converting the string "d83edd2a" to the  emoji.</p>
  
  <p>Apparently the encoding is UTF-16 but php detects it as ASCII.</p>
  
  <p>I've tried using hex2bin but this returns "Ø>Ý*" and php detects this as UTF-8, which makes sense to me.</p>
  
  <p>I've tried playing around with a couple of different attempts</p>
  
  <pre><code>$newCode = mb_convert_encoding($code, "ASCII", "UTF-16");
  </code></pre>
  
  <p>But this returns "????"</p>
  
  <pre><code>$newCode = iconv(mb_detect_encoding($code), 'ASCII', $hex);
  </code></pre>
  
  <p>But this also returns "????"</p>
  
  <p>I'm sure I'm missing something simple but I've ended up tying myself up in knots!</p>