title: C++: wide characters outputting incorrectly?
body: <p>My code is basically this:</p>
  
  <pre><code>wstring japan = L"日本";
  wstring message = L"Welcome! Japan is ";
  
  message += japan;
  
  wprintf(message.c_str());
  </code></pre>
  
  <p>I'm wishing to use wide strings but I do not know how they're outputted, so I used wprintf. When I run something such as:</p>
  
  <pre><code>./widestr | hexdump
  </code></pre>
  
  <p>The hexidecimal codepoints create this:</p>
  
  <pre><code>65 57 63 6c 6d 6f 21 65 4a 20 70 61 6e 61 69 20 20 73 3f 3f
  e  W  c  l  m  o  !  e  J     p  a  n  a  i        s  ?  ?
  </code></pre>
  
  <p>Why are they all jumped in order? I mean if the wprintf is wrong I still don't get why it'd output in such a specific jumbled order!</p>
  
  <p>edit: endianness or something? they seem to rotate each two characters. huh.</p>
  
  <p>EDIT 2: I tried using wcout, but it outputs the exact same hexidecimal codepoints. Weird!</p>