I'm using cpprestsdk to work with JSON. During creation of JSON I have a problem with special characters like Å
. For example:
json::value json;
std:string s = "ÅÅÅ";
std::wstring wstvalue(s.begin(), s.end());
json[L"key"] = json::value::string(wstvalue)
As JSON accepts only std::wstring
I can't convert correctly regular string to wstring. The result of json.key is strange and not corresponds to initial ÅÅÅ value.
How I can convert correctly regular std::string
to std::wstring
with characters like Å ?