title: How can I programmatically determine the current default codepage of Windows?
body: <p>I have to convert the encoding of a string output of a VB6 application to a specific encoding.</p>
  
  <p>The problem is, I don't know the encoding of the string, because of that:</p>
  
  <blockquote>
    <p>According to the VB6 documentation when accessing certain API functions the internal Unicode strings are converted to ANSI strings using the <em>default codepage</em> of Windows.</p>
  </blockquote>
  
  <p>Because of that, the encoding of the string output can be different on different systems, but I have to know it to perform the conversion. </p>
  
  <p>How can I read the default codepage using the Win32 API or - if there's no other way - by reading the registry?</p>