title: Show regional characters in MessageBox without setting required locale
body: <p>I need to show <code>MessageBox</code> with regional characters described in <code>ISO/IEC 8859-13</code> codepage without setting Windows locale to this region. I was naive and tried to show ASCI table with one byte character:</p>
  
  <pre><code>void showCodePage()
  {
  
  
      char *a = new char[10000];
      char *aa = new char[10000];
      int f=0;
      int lines =0;
      for (int i=1; i&lt;255;i++ )
      {
          sprintf(a,"%c %0.3d ",i,i);
          sprintf(aa,"%c",i);
          f++;
          a+=6;
          aa++;
  
          if (f==8)
          {
              f=0;
              sprintf(a,"%c",0x0d);
              a++;
              lines++;
          }
  
      }
  
      *aa=0;
      *a=0;
      a-=254*6+lines;
      aa-=254;
  
  
      MessageBox(NULL, aa , "Hello!", MB_ICONEXCLAMATION | MB_OK);
      MessageBox(NULL, a  , "Hello!", MB_ICONEXCLAMATION | MB_OK);
  
      delete [] a;
      delete [] aa;
  
  }
  </code></pre>
  
  <p>Ok, this doesn't shows ISO/IEC 8859-13 correctly and this is not possible without changing locale:</p>
  
  <p><img src="https://i.stack.imgur.com/09pLL.png" alt="enter image description here"></p>
  
  <p>Now I decide to make unicode wstring. Converting from single byte char to unicode wchar function:</p>
  
  <pre><code>wstring convert( const std::string&amp; as )
  {
      // deal with trivial case of empty string
      if( as.empty() )    return std::wstring();
  
      // determine required length of new string
      size_t reqLength = ::MultiByteToWideChar( CP_UTF8, 0, as.c_str(), (int)as.length(), 0, 0 );
  
      // construct new string of required length
      std::wstring ret( reqLength, L'\0' );
  
      // convert old string to new string
      ::MultiByteToWideChar( CP_UTF8, 0, as.c_str(), (int)as.length(), &amp;ret[0], (int)ret.length() );
  
      // return new string ( compiler should optimize this away )
      return ret;
  }
  </code></pre>
  
  <p>And changing MessageBox'es:</p>
  
  <pre><code>MessageBoxW(NULL, convert(aa).c_str(), L"Hello!", MB_ICONEXCLAMATION | MB_OK);
  MessageBoxW(NULL, convert(a).c_str() , L"Hello!", MB_ICONEXCLAMATION | MB_OK);
  </code></pre>
  
  <p>Result is still sad:</p>
  
  <p><img src="https://i.stack.imgur.com/AbLx2.png" alt="enter image description here"></p>
  
  <p>In other hand what I was expecting? I need somehow tell system which code page it should use to display may characters. How to do that? </p>