We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Chinese deserialization error
#include <json.hpp> using json_t = nlohmann::json; std::string ch="中文"; json_t j; j["ch_debug"]=ch.c_str(); j.dump();
JSON_THROW(type_error::create(316, "invalid UTF-8 byte at index " + std::to_string(i) + ": 0x" + ss.str(), BasicJsonType()));
win10 20he - IDE vs2019
3.10.5
develop
The text was updated successfully, but these errors were encountered:
Base 2.3
80623fd
rapidjson复用有些不熟悉,详细: Tencent/rapidjson#2013 更替为nlohmann_json,但中文反序列化时候不友好utf8,详细: nlohmann/json#3414 后续如果没有对应的api解决,将引入boost::uft8编码转换后在反序列化,所以数据只要是string都要处理,因为不知道是否有中文,否则序列化将抛出异常.
See https://json.nlohmann.me/home/exceptions/#jsonexceptiontype_error316
Sorry, something went wrong.
thank OK
No branches or pull requests
Description
Chinese deserialization error
Reproduction steps
#include <json.hpp>
using json_t = nlohmann::json;
std::string ch="中文";
json_t j;
j["ch_debug"]=ch.c_str();
j.dump();
Expected vs. actual results
Minimal code example
Error messages
Compiler and operating system
win10 20he - IDE vs2019
Library version
3.10.5
Validation
develop
branch is used.The text was updated successfully, but these errors were encountered: