I generated the following JSON using C++:
{
"ProfileID": "DUO1",
"ProfileName": "Sample"
}
The code used for generating that is:
string jsonData = "";
StringBuffer sb;
PrettyWriter<StringBuffer> writer(sb);
writer.StartObject();
writer.Key("ProfileID");
writer.String(strProfileId.c_str());
writer.Key("ProfileName");
writer.String(strName.c_str());
writer.EndObject();
jsonData = sb.GetString();
It is working fine for ProfileName in English. If the profile name is in another language (say Chinese), how can this be done?
I want generate JSON like this:
{
"ProfileID": "DUO1",
"ProfileName": "不用客气"
}
I was able to set this Chinese name in wstring
.
How to write this correctly to JSON?