title: Character entered by user is breaking xml decoding done by xml_parse_into_struct
body: <p>thanks for answering!
  This is about PHP/MySQL</p>
  
  <p>The user enters some text that is then processed through  <code>htmlentities()</code>:</p>
  
  <pre><code>$new_userinput = htmlentities($userinput, ENT_QUOTES);
  </code></pre>
  
  <p>This entry is stored in an XML:</p>
  
  <pre><code>...
  &lt;entrylist&gt;
      &lt;list&gt;$new_userinput&lt;/list&gt;
      &lt;info&gt;$someinfo&lt;/info&gt;
  &lt;/entrylist&gt;
  ...
  </code></pre>
  
  <p>The xml file is stored in a database in UTF-8 format. The HTML for the site is also set with UTF-8.</p>
  
  <p>What we observed is with a specific input, the xml being processed by:</p>
  
  <pre><code>$p = xml_parser_create();
  xml_parse_into_struct($p, $xmlentry, $values, $index);
  xml_parser_free($p);`
  </code></pre>
  
  <p>is not processed properly by the <code>xml_parse_into_struct()</code>.</p>
  
  <p>What we see in the database is the following:</p>
  
  <pre><code>...
  &lt;note&gt;Creatives share shots&amp;acirc;€”small screenshots.&lt;/note&gt;
  ...
  </code></pre>