title: Portable conversion of std::string to std::wstring and vice versa?
body: <p>I need to convert std::string to std::wstring. I have used something on below lines with visual studio 2010 (and it's working fine) :-</p>
  
  <pre><code>std::wstring_convert&lt;std::codecvt_utf8_utf16&lt;wchar_t&gt;&gt; converter;
  std::string narrow = converter.to_bytes(wide_utf16_source_string);
  std::wstring wide = converter.from_bytes(narrow_utf8_source_string);
  </code></pre>
  
  <p>However, when I build it on <code>gcc 4.3.4</code>, it gives error :-</p>
  
  <pre><code>  .cxx:333: error: 'wstring_convert' is not a member of 'std'
    .cxx:333: error: 'codecvt_utf8_utf16' is not a member of 'std'
  </code></pre>
  
  <p>Can anyone please provide me some way to do this conversion in platform independent way.</p>