title: Compiling Unicode with Visual Studio 2019
body: <p>I try to compile <a href="https://github.com/abergmeier/CnC_Remastered_Multiplatform/blob/ab5a4aef1dadab758e7e18e3cfb16dc3c9fed40f/TIBERIANDAWN/WIN32LIB/UNICODE_TEST.CPP" rel="nofollow noreferrer">this C++17 code</a> on VS2019:</p>
  
  <pre><code>int main() {
  
    if(!testCodepointEncode(U'\u221A', '\xFB') ||
       !testCodepointEncode(U'\u0040', '\x40') ||
       !testCodepointEncode(U'\u03A3', '\xE4') ||
       !testCodepointEncode(U'', '\xFE')) {
      return 1;
    }
    // Test 1 byte
    if(!testEncode("\u0040", "\x40")) {
      return 2;
    }
  
    // Test 2 byte
    if(!testEncode("\u03A3", "\xE4")) {
      return 3;
    }
  
    // Test 3 byte
    if(!testEncode("\u2502", "\xB3")) {
      return 4;
    }
  
    // Test 4 byte
    if(!testEncode("", "\xFE")) {
      return 5;
    }
  
    if(!testArray("F ⌠ Z", "\x46\x20\xF4\x20\x5A")) {
      return 6;
    }
  
    if(!testView("F ⌠ Z", "\x46\x20\xF4\x20\x5A")) {
      return 7;
    }
    return 0;
  }
  </code></pre>
  
  <p>It compiles and works fine with gcc and clang on Linux, but MSVC complains:</p>
  
  <pre>
  UNICODE_TEST.CPP(65,27): error C2015: too many characters in constant 
  UNICODE_TEST.CPP(75,18): warning C4566: character represented by universal-character-name '\u03A3' cannot be represented in the current code page (1252) 
  UNICODE_TEST.CPP(80,18): warning C4566: character represented by universal-character-name '\u2502' cannot be represented in the current code page (1252)
  </pre>
  
  <p>I tried setting the current codepage to UTF-8, but the errors persisted.</p>
  
  <p>How is one supposed to compile this code on Windows?</p>