Closed
Description
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 API
assert(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
Metadata
Metadata
Assignees
Labels
No labels