title: Emojis from HTML to Word 2010
body: <p>I have a PHP program that creates an HTML doc from WordPress content. That HTML document is then imported (opened) into Word2010 for further editing. The issue is that emjois (and words such as <code>I'm</code> are not converted properly when opened in Word.</p>
  
  <p>The HTML document has this at the beginning, to specify UTF-8 as the character encoding:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;meta charset="UTF-8"&gt;
  ...etc...
  </code></pre>
  
  <p>If I look at the HTML in browser, I see that the HTTP Content header is set to UTF-8, and the emojis display properly.</p>
  
  <p>In Word 2010, the emoji is displayed as </p>
  
  <p><a href="https://i.stack.imgur.com/W3kde.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/W3kde.jpg" alt="Word 2010 screenshot"></a></p>
  
  <p>In the browser (FF/latest), it looks like this:</p>
  
  <p><a href="https://i.stack.imgur.com/4MfWq.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4MfWq.jpg" alt="Browser screenshot"></a></p>
  
  <p>You can see that the emjoi, and the single-quote character in the word <code>I'm</code> are not converted properly when the HTML document is opened in Word. This is even after I save the file as a DOCX, and re-open the file.  I have also converted all on-line pictures to embedded pictures.</p>
  
  <p>Is this a DOCTYPE or charset issue? Or do I need to convert the emoji character code with a PHP command before outputting (saving) the HTML file in my PHP program?</p>
  
  <p><strong>Added</strong></p>
  
  <p>Here is the text of that same area (shown in the image/screencaps) as shown in Notepad++</p>
  
  <pre><code>Hi mom&amp;eth;&amp;#159;&amp;#145;&amp;#139; So I&amp;acirc;&amp;#128;&amp;#153;m thinking 
  </code></pre>
  
  <p>I need to 'convert' the codes in there to something that Word will recognize as an emoji (which are different from emoticons). I tried using the wp_encode_emoji function (here) on the content before it is saved to the HTML file, but no joy.</p>
  
  <p>I also tried to use LibreOffice (latest version) on the HTML file, but the emojis are not converted properly. </p>
  
  <p>Is there a PHP function/code that will convert the codes such as <code>&amp;eth;&amp;#159;&amp;#145;&amp;#139;</code>  into Word-capable-emojis ?</p>