MSXML4 and setting the encoding string
问题 I using MSXML4 to generate a XML. I'm trying to set the encoding value to UTF-8. Here is my code: const _bstr_t k_XML_Tag_Name ("xml"); const _bstr_t k_Processing_Tag_Name ("version=\"1.0\" encoding=\"utf-8\""); MSXML2::IXMLDOMProcessingInstructionPtr pProccessingInstruction = m_pXmlDoc->createProcessingInstruction(k_XML_Tag_Name, k_Processing_Tag_Name); HRESULT result = m_pXmlDoc->appendChild(pProccessingInstruction); result is always S_FALSE and the preprocessing string is: <?xml version="1