我有这段代码将一些成员添加到对象类型文档
void test01(rapidjson::Document& doc)
{
doc.AddMember("test01", 123, doc.GetAllocator());
char name[] = "test02";
doc.AddMember(name, 2, doc.GetAllocator());
string sname = "test03";
doc.AddMember(sname.c_str(), 3, doc.GetAllocator());
}
和这件作品来序列化它
rapidjson::StringBuffer buffer;
rapidjson::PrettyWriter<rapidjson::StringBuffer> writer (buffer);
document.Accept (writer);
std::string json = buffer.GetString();
但得到的价值是
{
"test01": 123,
"ÌÌÌÌÌÌ": 2,
"ÌÌÌÌÌÌ": 3
}
有人知道为什么吗?