title: How do I convert a string in UTF-16 to UTF-8 in C++
body: <p>Consider:</p>
  
  <pre><code>STDMETHODIMP CFileSystemAPI::setRRConfig( BSTR config_str, VARIANT* ret )
  {
  mReportReaderFactory.reset( new sbis::report_reader::ReportReaderFactory() );
  
  USES_CONVERSION;
  std::string configuration_str = W2A( config_str );
  </code></pre>
  
  <p>But in config_str I get a string in UTF-16. How can I convert it to UTF-8 in this piece of code?</p>