|
同样的一段代码在EVC下执行和在VC下执行后生成的XML文件,用十六进制编码器查看发现中文编码完全不一样,用VC执行后生成的xml文件在EVC中读取中文内容为乱码,请各位指点下!代码如下
CMarkup *m_pXML=new CMarkup();
m_pXML->AddElem(_T("PatrolTable"));
CString csTemp;
for (int i = 0; i < 5; i++)
{
m_pXML->AddChildElem(_T("Record"));
m_pXML->IntoElem();
m_pXML->AddChildElem(_T("ID"),1,0);
m_pXML->AddChildElem(_T("TASKID"),2,0);
m_pXML->AddChildElem(_T("LINEID"),3,0);
m_pXML->AddChildElem(_T("LINENAME"), _T("A区大楼"),0);
m_pXML->AddChildElem(_T("EQUIPID"),2,0);
m_pXML->AddChildElem(_T("EQUIPRFID"),_T("131313"),0);
m_pXML->AddChildElem(_T("EQUIPNAME"),_T("巡检点2"),0);
m_pXML->AddChildElem(_T("REQTIME"),_T("2008-6-14 14:18:14"),0);
m_pXML->AddChildElem(_T("REQPERSONID"),_T("007"),0);
m_pXML->AddChildElem(_T("REQPERSONNAME"),_T("张三"),0);
m_pXML->AddChildElem(_T("FACTTIME"),_T("2008-6-14 14:18:14"),0);
m_pXML->AddChildElem(_T("FACTPERSONID"),_T(""),0);
m_pXML->AddChildElem(_T("FACTPERSONNAME"),_T(""),0);
m_pXML->AddChildElem(_T("STATUS"),1,0);
m_pXML->AddChildElem(_T("REASON"),_T("呵"),0);
m_pXML->AddChildElem(_T("MEMO"),_T("呵"),0);
m_pXML->OutOfElem();
}
m_pXML->Save(_T("c:\\UserInfo.xml"));
delete m_pXML;
|
|