Boost C++ Libraries: Ticket #9782: boost::property_tree::write_json always pretty prints ] when encoding arrays https://svn.boost.org/trac10/ticket/9782 <p> generally the result is unnecessary white space in the resulting json string </p> <p> this can be resolved by changing line 96 of 'boost\property_tree\detail\json_parser_write.hpp' from </p> <pre class="wiki"> stream &lt;&lt; Str(4 * indent, Ch(' ')) &lt;&lt; Ch(']'); </pre><p> to </p> <pre class="wiki"> if (pretty) stream &lt;&lt; Str(4 * indent, Ch(' ')); stream &lt;&lt; Ch(']'); </pre><p> which is consistent in style and functionality with lines 120 and 121 of the same file </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/9782 Trac 1.4.3 Sebastian Redl Fri, 23 Jan 2015 11:16:12 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/9782#comment:1 https://svn.boost.org/trac10/ticket/9782#comment:1 <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