$doc_dest = '001.xml';
$xw = xmlwriter_open_uri($doc_dest);
-xmlwriter_start_document($xw, '1.0', 'utf8');
+xmlwriter_start_document($xw, '1.0', 'UTF-8');
xmlwriter_start_element($xw, "tag1");
xmlwriter_end_document($xw);
// Force to write and empty the buffer
$output_bytes = xmlwriter_flush($xw, true);
echo file_get_contents($doc_dest);
+unset($xw);
unlink('001.xml');
?>
===DONE===
--EXPECT--
-<?xml version="1.0" encoding="utf8"?>
+<?xml version="1.0" encoding="UTF-8"?>
<tag1/>
===DONE===
$doc_dest = '001.xml';
$xw = xmlwriter_open_memory($doc_dest);
-xmlwriter_start_document($xw, '1.0', 'utf8');
+xmlwriter_start_document($xw, '1.0', 'UTF-8');
xmlwriter_start_element($xw, "tag1");
xmlwriter_end_document($xw);
?>
===DONE===
--EXPECT--
-<?xml version="1.0" encoding="utf8"?>
+<?xml version="1.0" encoding="UTF-8"?>
<tag1/>
===DONE===
$doc_dest = '001.xml';
$xw = xmlwriter_open_memory($doc_dest);
-xmlwriter_start_document($xw, '1.0', 'utf8');
+xmlwriter_start_document($xw, '1.0', 'UTF-8');
xmlwriter_start_element($xw, "tag1");
?>
===DONE===
--EXPECT--
-<?xml version="1.0" encoding="utf8"?>
+<?xml version="1.0" encoding="UTF-8"?>
<tag1 attr1="attr1_value" att2="att2_value">Test text for tag1<tag2/></tag1>
===DONE===
$doc_dest = '001.xml';
$xw = xmlwriter_open_uri($doc_dest);
-xmlwriter_start_document($xw, '1.0', 'utf8');
+xmlwriter_start_document($xw, '1.0', 'UTF-8');
xmlwriter_start_element($xw, "tag1");
xmlwriter_start_pi($xw, "PHP");
// Force to write and empty the buffer
$output_bytes = xmlwriter_flush($xw, true);
$md5_out = md5_file($doc_dest);
-$md5_res = md5('<?xml version="1.0" encoding="utf8"?>
+$md5_res = md5('<?xml version="1.0" encoding="UTF-8"?>
<tag1><?PHP echo $a;?></tag1>
');
+unset($xw);
unlink('001.xml');
if ($md5_out != $md5_res) {
echo "failed: $md5_res != $md5_out\n";
$doc_dest = '001.xml';
$xw = xmlwriter_open_uri($doc_dest);
-xmlwriter_start_document($xw, '1.0', 'utf8');
+xmlwriter_start_document($xw, '1.0', 'UTF-8');
xmlwriter_start_element($xw, "tag1");
xmlwriter_start_comment($xw);
// Force to write and empty the buffer
$output_bytes = xmlwriter_flush($xw, true);
echo file_get_contents($doc_dest);
+unset($xw);
unlink('001.xml');
?>
===DONE===
--EXPECT--
-<?xml version="1.0" encoding="utf8"?>
+<?xml version="1.0" encoding="UTF-8"?>
<tag1><!--comment--><!--comment #2--></tag1>
===DONE===
$doc_dest = '001.xml';
$xw = new XMLWriter();
$xw->openUri($doc_dest);
-$xw->startDocument('1.0', 'utf8', 'standalonearg');
+$xw->startDocument('1.0', 'UTF-8', 'standalonearg');
$xw->startElement("tag1");
$xw->endDocument();
// Force to write and empty the buffer
$output_bytes = $xw->flush(true);
echo file_get_contents($doc_dest);
+unset($xw);
unlink('001.xml');
?>
===DONE===
--EXPECT--
-<?xml version="1.0" encoding="utf8" standalone="standalonearg"?>
+<?xml version="1.0" encoding="UTF-8" standalone="standalonearg"?>
<tag1/>
===DONE===
$xw = new XMLWriter();
$xw->openMemory();
-$xw->startDocument('1.0', 'utf8', 'standalone');
+$xw->startDocument('1.0', 'UTF-8', 'standalone');
$xw->startElement("tag1");
$xw->endDocument();
?>
===DONE===
--EXPECT--
-<?xml version="1.0" encoding="utf8" standalone="standalone"?>
+<?xml version="1.0" encoding="UTF-8" standalone="standalone"?>
<tag1/>
===DONE===
$xw = new XMLWriter();
$xw->openMemory();
-$xw->startDocument('1.0', 'utf8');
+$xw->startDocument('1.0', 'UTF-8');
$xw->startElement("tag1");
$res = $xw->startAttribute('attr1');
?>
===DONE===
--EXPECT--
-<?xml version="1.0" encoding="utf8"?>
+<?xml version="1.0" encoding="UTF-8"?>
<tag1 attr1="attr1_value" attr2="attr2_value">Test text for tag1<tag2/></tag1>
===DONE===
$doc_dest = '001.xml';
$xw = new XMLWriter();
$xw->openUri($doc_dest);
-$xw->startDocument('1.0', 'utf8');
+$xw->startDocument('1.0', 'UTF-8');
$xw->startElement("tag1");
$xw->startPi("PHP");
// Force to write and empty the buffer
$xw->flush(true);
$md5_out = md5_file($doc_dest);
-$md5_res = md5('<?xml version="1.0" encoding="utf8"?>
+$md5_res = md5('<?xml version="1.0" encoding="UTF-8"?>
<tag1><?PHP echo $a;?></tag1>
');
+unset($xw);
unlink('001.xml');
if ($md5_out != $md5_res) {
echo "failed: $md5_res != $md5_out\n";
$doc_dest = '001.xml';
$xw = new XMLWriter();
$xw->openUri($doc_dest);
-$xw->startDocument('1.0', 'utf8');
+$xw->startDocument('1.0', 'UTF-8');
$xw->startElement("tag1");
$xw->startComment();
$xw->text('comment');
// Force to write and empty the buffer
$output_bytes = $xw->flush(true);
echo file_get_contents($doc_dest);
+unset($xw);
unlink('001.xml');
?>
===DONE===
--EXPECT--
-<?xml version="1.0" encoding="utf8"?>
+<?xml version="1.0" encoding="UTF-8"?>
<tag1><!--comment--><!--comment #2--></tag1>
===DONE===