title: boost::property_tree::json_parser and two-byte wide characters
body: <h1>Introduction</h1>
  
  <pre><code>std::string text = "á";
  </code></pre>
  
  <p>"á" is two-byte character (assuming a UTF-8 encoding).<br>
  So following line prints 2. </p>
  
  <pre><code>std::cout &lt;&lt; text.size() &lt;&lt; "\n";
  </code></pre>
  
  <p>But <code>std::cout</code> still prints text correctly.</p>
  
  <pre><code>std::cout &lt;&lt; text &lt;&lt; "\n";
  </code></pre>
  
  <h1>My problem</h1>
  
  <p>I pass <code>text</code> to <code>boost::property_tree::ptree</code> and then to <code>write_json</code> </p>
  
  <pre><code>boost::property_tree::ptree root;
  root.put&lt;std::string&gt;("text", text);
  
  std::stringstream ss;
  boost::property_tree::json_parser::write_json(ss, root);
  std::cout &lt;&lt; ss.str() &lt;&lt; "\n";
  </code></pre>
  
  <p>The result is </p>
  
  <pre><code>{
      "text": "\u00C3\u00A1"
  }
  </code></pre>
  
  <p>text is equal to "Ã¡" which is different than "á". </p>
  
  <p>Is is possible to fix this problem without switching to <code>std::wstring</code>? Is it possible that changing library (<code>boost::property_tree::ptree</code>) can solve this problem ?</p>