title: UTF-8 in Windows
body: <p>How do I set the code page to UTF-8 in a C Windows program?  </p>
  
  <p>I have a third party library that uses fopen to open files. I can use wcstombs to convert my Unicode filenames to the current code page, however if the user has a filename with a character outside the code page then this breaks.  </p>
  
  <p>Ideally I would just call _setmbcp(65001) to set the code page to UTF-8, however the MSDN documentation for _setmbcp states that UTF-8 is not supported.  </p>
  
  <p>How can I get around this?</p>