Boost C++ Libraries: Ticket #9765: write_json(.., /*pretty=*/false) still outputs unnecessary spaces https://svn.boost.org/trac10/ticket/9765 <p> Using boost::property_tree::write_json(output, data, /*pretty=*/false); with an array in the data still outputs spaces before the ']'. </p> <p> When you want to calculate HASH-es from JSON (and therefor do not want extra whitespaces in it) generated by different tools that is a problem. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/9765 Trac 1.4.3 anonymous Mon, 10 Mar 2014 11:46:59 GMT <link>https://svn.boost.org/trac10/ticket/9765#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9765#comment:1</guid> <description> <p> See <a href="http://www.boost.org/doc/libs/1_55_0/boost/property_tree/detail/json_parser_write.hpp">http://www.boost.org/doc/libs/1_55_0/boost/property_tree/detail/json_parser_write.hpp</a> : </p> <p> In function 'write_json_helper' please replace the line: </p> <p> <strong>stream &lt;&lt; Str(4 * indent, Ch(' ')) &lt;&lt; Ch(']');</strong> </p> <p> With the 2 lines: </p> <p> <strong>if (pretty) stream &lt;&lt; Str(4 * indent, Ch(' '));<br /> stream &lt;&lt; Ch(']');</strong> </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Sebastian Redl</dc:creator> <pubDate>Fri, 23 Jan 2015 11:15:43 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/9765#comment:2 https://svn.boost.org/trac10/ticket/9765#comment:2 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">duplicate</span> </li> </ul> <p> Dupe of <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/7180" title="#7180: Bugs: Property Tree: json_write() pretty = false option not fully respected ... (closed: fixed)">#7180</a>. </p> Ticket