title: How to force XPath to use UTF8?
body: <p>I have an XHTML document being passed to a PHP app via Greasemonkey AJAX. The PHP app uses UTF8. If I output the POST content straight back to a textarea in the AJAX receiving div, everything is still properly encoded in UTF8.</p>
  
  <p>When I try to parse using XPath</p>
  
  <pre><code>$dom = new DOMDocument();
  $dom-&gt;loadHTML($raw2);
  $xpath = new DOMXPath($dom);
  $query = '//td/text()';
  $nodes = $xpath-&gt;query($query);
  foreach($nodes as $node) {
    var_dump($node-&gt;wholeText);
  }
  </code></pre>
  
  <p>dumped strings are not utf8. How do I force DOM/XPath to use UTF8?</p>