Boost C++ Libraries: Ticket #10022: json_parser_write inconditionally converts CP1252 to escaped unicode https://svn.boost.org/trac10/ticket/10022 <p> See function 'create_escapes' in property_tree/detail/json_parser_write.hpp. I supply a property_tree containing UTF-8 encoded values, encoded in a custom way from data in different code pages. I want JSON with real UTF-8 encoding, which the JSON standard just allows (as far as I googled). So here the encoding of 'special' characters to "\uXXXX" should be turned off. </p> <p> All values the Ch has are directly translated to a unicode number, but when Ch=char this only works correct when the char data is in code page 1252. </p> <p> Currently the option to encode the characters nor the used code page are parameters here. </p> <p> I needed to locally adapt the code like in <a class="ext-link" href="http://stackoverflow.com/questions/10260688/boostproperty-treejson-parser-and-two-byte-wide-characters"><span class="icon">​</span>http://stackoverflow.com/questions/10260688/boostproperty-treejson-parser-and-two-byte-wide-characters</a> </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/10022 Trac 1.4.3 anonymous Thu, 08 May 2014 12:40:16 GMT <link>https://svn.boost.org/trac10/ticket/10022#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/10022#comment:1</guid> <description> <p> Now comment in the code states: "This assumes an ASCII superset. But so does everything in PTree." </p> <p> A PTree is, as far as used to serialize / parse JSON, fine with handling UTF-8 encoded values. </p> <p> And: "We escape everything outside ASCII, because this code can't handle high unicode characters." </p> <p> Strange, the JSON generated is parsed fine using boost and the resulting PTree contains correctly encoded values again. </p> </description> <category>Ticket</category> </item> </channel> </rss>