You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I build a json object containing UTF8 encoded value of string "式,进"
serialize this json object to string
parse the string again into another json object and read the value
Result: string is lost
here is sample pseudo code
Json::Value json;
json["abc"] = UnicodeToUTF8(L"式,进"); // wrapper over MultiByteToWideChar API// serialize json to string
std::string jsonString = json.toStyledString();
// now parse again
Json::Value json2 = parse(jsonString); // parse using Json::CharReader
std::wstring unicodeString = UTF8ToUnicode(json2["abc"]); // wrapper over MultiByteToWideChar APIassert(unicodeString == L"式,进"); // fails
I checked UnicodeToUTF8 and UTF8ToUnicode works fine.
The only problem I see in toStyledString() API which make character encoding weird in output