title: PHP's SimpleXML not handling &#8217 ; properly
body: <p>I'm parsing an RSS feed that has an <code>&amp;#8217;</code> in it. SimpleXML turns this into a â€™. What can I do to stop this?</p>
  
  <p>Just to answer some of the questions that have come up - I'm pulling an RSS feed using CURL. If I output this directly to the browser, the <code>&amp;#8217;</code> displays as &#8217; which is what's expected. When I create a new SimpleXMLElement using this, (e.g. <code>$xml = new SimpleXmlElement($raw_feed);</code> and dump the <code>$xml</code> variable, every instance of <code>&amp;#8217;</code> is replaced with â€™.</p>
  
  <p>It appears that SimpleXML is having trouble with UTF-8 ampersand encoded characters. (The XML declaration specifies UTF-8.)</p>
  
  <p>I do have control over the feed after CURL has retrieved the feed before it's used to construct a SimpleXML element.</p>