
Hi Mathias, Thanks for your response. I was expecting write_xml(with "utf-8") to do the escape(e.g < replaced with <) or strip any invalid characters(e.g. anything other than #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF]) Is this part of the write_xml()? Do let me know if this is not clear. Regards,Rohan From: Mathias Gaunard <mathias.gaunard@ens-lyon.org> To: boost@lists.boost.org Sent: Monday, March 2, 2015 10:10 PM Subject: Re: [boost] An invalid XML character (Unicode: 0x8) problem because of property_tree::xml_parser::write_xml On 02/03/2015 05:59, Rohan Shetty wrote:
Hi, I have used the following C++ code to generate the xml boost::property_tree::ptree ptResponse; // Populate the tree from the Microsoft Outlook contactsstd::stringstream buf; const std::string enc("utf-8"); boost::property_tree::xml_writer_settings<char> settings(' ', 0, enc); boost::property_tree::xml_parser::write_xml(buf, ptResponse, settings); This works fine. But in one of the customer's machine, when reading the this(xml content) in a JAVA program. I get the following error An invalid XML character (Unicode: 0x8) was found in the element content of the document.
Any help in solving this is appreciated.
I don't understand, the error message is quite explicit: your data isn't utf-8 even though you said it was. What were you expecting to happen? Also this would probably be more suited to the boost-users mailing list. _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost