Как читать японскую строку, используя boost::property_tree::read_json
I have json with a Japanese string
{
"title":"\u4e2d\u6587\u901a\u77e5\u53f0\u5934"
}
while I parse using the following code I don't get this above Japanese string,
Msg contains the json as a string.
try {
boost::property_tree::ptree pt;
std::istringstream isbuf(Msg.c_str());
boost::property_tree::read_json(isbuf, pt);
std::string title = pt.get<string>("title", "");
} catch (std::exception const& e) {
printf("Invalid : %s", e.what());
}
[править] Я получаю это строковое значение в объекте std:: string, но исходная проблема возникает, когда я использую строку в диалоге Windows в качестве статического текста. Я решил использовать wstring titleW = boost::locale::conv::utf_to_utf(title);
Чем использовал titleW в диалоговом окне Windows.
Заранее спасибо Birajendu