This is my code:
$oDom = new DOMDocument();
$oDom->loadHTML(\"èàéìòù\");
echo $oDom->saveHTML();
This is the output:
The issue appears to be known, according to the user comments on the manual page at php.net. Solutions suggested there include putting
in the document before you put any strings with non-ASCII chars in.
Another hack suggests putting
as the first text in the document and then removing it at the end.
Nasty stuff. Smells like a bug to me.