Boost C++ Libraries: Ticket #4314: write_json() create_escapes() https://svn.boost.org/trac10/ticket/4314 <p> <strong>Bad handling of escaping:</strong> </p> <p> From an std::string, *b is a char (not unsigned char). </p> <pre class="wiki">unsigned long u = (std::min)(static_cast&lt;unsigned long&gt;(*b), 0xFFFFul); </pre><p> This line converts all chars with a negative value to 0xFFFFul. </p> <p> On Mac OSX 10.6 there is a problem with std::locale, it cannot be changed to something else than 'C'. The strings I added in my ptree are already UTF-8 encoded. </p> <p> All french accents become uFFFF\uFFFF with write_json() while they are written fine with write_xml(). </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/4314 Trac 1.4.3 Sebastian Redl Fri, 22 Oct 2010 12:33:15 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/4314#comment:1 https://svn.boost.org/trac10/ticket/4314#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">fixed</span> </li> </ul> <p> Fixed on trunk and release. Code now first casts to unsigned char. </p> Ticket