I have an XML file which has UTF-8 BOM marker(EF BB BF) at the beginning.
It also contains encoding as <?xml version="1.0" encoding="UTF-8" ?>.
I am trying to load this XML file using IXMLDOMDocument::LoadXML which fails to load this document. If I remove the BOM marker it works perfectly.
My question is it wrong to have the BOM marker in this case or is it a bug with MSXML (MSXML6 to be precise)?
The
IXMLDOMDocument::loadXMLmethod expects aBSTR, which is UTF-16 encoded. See this page for a discussion of the issue.I suggest to use
IXMLDOMDocument::loadinstead, which has various overloads which don’t require UTF-16.