JSON库
https://github.com/open-source-parsers/jsoncpp
解决jsoncpp中文乱码问题_weruoaszxcvnm的博客-CSDN博客_jsoncpp中文乱码
jsoncpp 中文字符串被转为 u uf8的解决办法 - 走看看
jsoncpp 中文字符串被转为 u uf8的解决办法:
std::string JsonToString(const Json::Value & root) { static Json::Value def = []() { Json::Value def; Json::StreamWriterBuilder::setDefaults(&def); def["emitUTF8"] = true; return def; }(); std::ostringstream stream; Json::StreamWriterBuilder stream_builder; stream_builder.settings_ = def;//Config emitUTF8 std::unique_ptr<Json::StreamWriter> writer(stream_builder.newStreamWriter()); writer->write(root, &stream); return stream.str(); }
GitHub - nlohmann/json: JSON for Modern C++