Take this simple PHP code:
$xmlWriter = new XMLWriter();
$xmlWriter->openURI(\'php://output\');
$xmlWriter->startDocument(\'1.0\', \'utf-8\');
$xmlWri
I'm not sure where you got the idea that XMLWriter
converts encodings. It doesn't. You must supply it with utf-8. It can output different encodings, but input strings must be utf-8.
One of two things may be going on here:
header('Content-Type: application/xml; charset=UTF-8');