I am trying to parse xml which has Unicode chars but rapidxml is giving exception when I call parse function.
Attaching code snippet.
Note: Same code is able to parse ascii containt.
bool
ParseXmlData(const std::wstring &XmlData)
{
LPCTSTR thisMethod = L"ParseXmlData()";
wchar_t* wc_xmlstring = wcsdup(XmlData.c_str());
xml_document<wchar_t> xmldoc;
try
{
xmldoc.parse<0>(wc_xmlstring);
}
catch (rapidxml::parse_error &e)
{
std::cout << e.what()
free (dupStr);
return false;
}
-
-
-
-
return true
}
I could reproduce your issue with your input, though it is not reproduced with every Korean character. It turns out that rapidxml has bug when parsing characters outside look up table size.
You can find full patch here. I have verified that problem is fixed after applying this patch.
Hope it will be useful.