On 11/10/2017 01:33 PM, Tomáš Chvátal wrote:
2017-11-06 9:58 GMT+01:00 Stephan Bergmann <[email protected] <mailto:[email protected]> <mailto:[email protected] <mailto:[email protected]>>>:Looking at the surrounding code // Get redline info. boost::property_tree::ptree aTree; char* pJSON = pDocument->m_pDocumentClass->getCommandValues(pDocument, ".uno:AcceptTrackedChanges"); std::stringstream aStream(pJSON); free(pJSON); CPPUNIT_ASSERT(!aStream.str().empty()); boost::property_tree::read_json(aStream, aTree); // Make sure that pressing a key creates exactly one redline. CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), aTree.get_child("redlines").size()); what's the binary content of that "char* pJSON" stream? If that's still intact, then it's apparently boost::property_tree::read_json that's breaking things. And if that's already garbled, then it's apparently the producer side of that pDocument->m_pDocumentClass->getCommandValues (whatever that is) that is breaking it and needs further investigation.$8 = 0x2076820 "{\n \"redlines\":\n [\n {\n", ' ' <repeats 12 times>, "\"index\": \"1\",\n", ' ' <repeats 12 times>, "\"author\": \"Unknown Author\",\n", ' ' <repeats 12 times>, "\"type\": \"Insert\",\n", ' ' <repeats 12 times>, "\"comment\": \"\",\n", ' ' <repeats 12 times>, "\"description\": \"Insert \\u00E2\\u0080\\u009Ct\\u00E2\\u0080\\u009D\",\n", ' ' <repeats 12 times>, "\"dateTime\": \"2017-11-10T12:29:40\",\n", ' ' <repeats 12 times>, "\"textRange\": \"1418, 1418, 67, 275\"\n }\n ]\n}\n"
So this apparently already got broken on the producing side, converting individual Unicode characters into sequences of three Unicode characters each, \u00E2\u0080\u009C and \u00E2\u0080\u009D, respectively.
_______________________________________________ LibreOffice mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice
