我在vc工程中用tinyXML创建了一个xml并保存为xml文件,可是xml文件的编码格式老是ANSI,请问如何保存为UTF-8?代码如下,大家帮帮忙~
char floader[200];
TiXmlDocument *myBackDoc = NULL;
myBackDoc  =  new TiXmlDocument();
TiXmlDeclaration * decl = new TiXmlDeclaration("1.0","","");
myBackDoc->LinkEndChild(decl);
TiXmlElement *rootElementBack = NULL, *errElementBack = NULL, *ticketElementBack = NULL,*a,*b,*c,*d;
rootElementBack   = new TiXmlElement("infoPic");
myBackDoc->LinkEndChild(rootElementBack);

ticketElementBack =  new TiXmlElement("pic");
errElementBack=new TiXmlElement("url");
errElementBack->InsertEndChild(TiXmlText("D:\\My Documents\\My Pictures\\视频抓拍\\2009年03月10日09时46分16秒.jpg"));
ticketElementBack->LinkEndChild(errElementBack);
a=new TiXmlElement("content");
a->InsertEndChild(TiXmlText("2009年03月10日09时46分16秒.jpg"));
ticketElementBack->LinkEndChild(a); rootElementBack->LinkEndChild(ticketElementBack);    b =  new TiXmlElement("pic");
c=new TiXmlElement("url");
CString str1;
str1="D:\\My Documents\\My Pictures\\视频抓拍\\2009年03月10日09时46分16秒.jpg";
c->InsertEndChild(TiXmlText(str1));
b->LinkEndChild(c);
d=new TiXmlElement("content");
d->InsertEndChild(TiXmlText("2009年03月10日09时46分16秒.jpg"));
b->LinkEndChild(d); rootElementBack->LinkEndChild(b); sprintf(floader,"photo.ui");
myBackDoc->SaveFile(floader);
delete myBackDoc;