title: Confused about C++'s std::wstring, UTF-16, UTF-8 and displaying strings in a windows GUI
body: <p>I'm working on a english only C++ program for Windows where we were told "always use std::wstring", but it seems like nobody on the team really has much of an understanding beyond that.</p>
  
  <p>I already read the question titled <a href="https://stackoverflow.com/questions/402283/stdwstring-vs-stdstring">"std::wstring VS std::string</a>.  It was very helpful, but I still don't quite understand how to apply all of that information to my problem.</p>
  
  <p>The program I'm working on displays data in a Windows GUI.  That data is persisted as XML.  We often transform that XML using XSLT into HTML or XSL:FO for reporting purposes.</p>
  
  <p>My feeling based on what I have read is that the HTML should be encoded as UTF-8.  I know very little about GUI development, but the little bit I have read indicates that the GUI stuff is all based on UTF-16 encoded strings.</p>
  
  <p>I'm trying to understand where this leaves me. Say we decide that all of our persisted data should be UTF-8 encoded XML.  Does this mean that in order to display persisted data in a UI component, I should really be performing some sort of explicit UTF-8 to UTF-16 transcoding process?</p>
  
  <p>I suspect my explanation could use clarification, so I'll try to provide that if you have any questions.</p>