pugixml库的一个使用心得

               

作者:朱金灿

来源:http://blog.csdn.net/clever101

 

     使用pugixml库解析xml文件时发现一个规则。如果是解析英文的unicode字符的xml文件(包括utf8和utf16),可以直接使用xml_document类的load_file接口直接打开xml文件。但是要解析包含中文、日文等文字的unicode字符的xml文件,就必须使用xml_document类的load接口。具体用法如下:


std::locale::global(std::locale("chs"));const std::wstring strFilePath = _T(“c:\\ xgconsole.xml”);std::wifstream stream(strFilePath.c_str());pugi::xml_document doc;doc.load(stream);


           

再分享一下我老师大神的人工智能教程吧。零基础!通俗易懂!风趣幽默!还带黄段子!希望你也加入到我们人工智能的队伍中来!https://blog.csdn.net/jiangjunshow

猜你喜欢

转载自blog.csdn.net/gdruhv/article/details/86491079