title: PHP DOMDocument, Unicode problems
body: <p>I have some problem here</p>
  
  <pre><code>$source = "&lt;html&gt;&lt;body&gt;&lt;h1&gt;&amp;#8220;&lt;/h1&gt;&lt;/body&gt;&lt;/html&gt;";
  $dom = new DOMDocument();
  $dom-&gt;loadHTML($source);
  echo $dom-&gt;saveHTML();
  </code></pre>
  
  <p>Output: </p>
  
  <blockquote>
    <p>&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD HTML 4.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/REC-html40/loose.dtd&quot;&gt;
    &lt;html&gt;&lt;body&gt;&lt;h1&gt;&amp;ldquo;&lt;/h1&gt;&lt;/body&gt;&lt;/html&gt;</p>
  </blockquote>
  
  <p>Ok, this work correctly.
  But if I want to extract the nodes like this</p>
  
  <pre><code>$source = "&lt;html&gt;&lt;body&gt;&lt;h1&gt;&amp;#8220;&lt;/h1&gt;&lt;/body&gt;&lt;/html&gt;";
  $dom = new DOMDocument();
  $dom-&gt;loadHTML($source);
  $h1 = $dom-&gt;getElementsByTagName('h1');
  echo $dom-&gt;saveHTML($h1-&gt;item(0));
  </code></pre>
  
  <p>It output unrecognized text. </p>
  
  <blockquote>
    <p>&lt;h1&gt;â€œ&lt;/h1&gt;</p>
  </blockquote>
  
  <p>Anyone know how to solve this?</p>