Closed
Description
Json::Value json_temp;
json_temp["name"] = "中国234";
string name = json_temp["name"].asString();
Json::Value root;
root["key_number"] = Json::Value(12345);
root["key_boolean"] = Json::Value(false);
root["key_double"] = Json::Value(12.345);
root["key_object"] = json_temp;
Json::StreamWriterBuilder builder;
builder["commentStyle"] = "None";
builder["indentation"] = "";
//string s = fast_writer.write(root);
//string_t s = utility::conversions::to_string_t(fast_writer.write(root));
//string result = fast_writer.write(root);
string result = Json::writeString(builder, root);
cout <<"name: "<< name << endl; //is ok
cout <<"result: "<< result << endl; //no ok
......
print info:
name: 中国234
result: {"key_boolean":false,"key_double":12.345000000000001,"key_number":12345,"key_object":{"name":"\u0590\u067a234"}}
jsoncpp version:1.8.4
ide: visual studio 2017 c++
The value of the variable name is displayed in Chinese, and the Chinese contained in variable result cannot be displayed properly.
Metadata
Metadata
Assignees
Labels
No labels