title: wprintf UTF16 (should be UTF8) on Linux?
body: <p>1 It's really strange that wprintf show 'Ω' as 3A9 (UTF16), but wctomb convert
  wchar to CEA9 (UTF8), my locale is default en_US.utf8. As man-pages said,
  they should comform to my locale, but wpritnf use UTF16, why?</p>
  
  <p>excerpt from <a href="http://www.fileformat.info/info/unicode/char/3a9/index.htm" rel="nofollow">http://www.fileformat.info/info/unicode/char/3a9/index.htm</a></p>
  
  <p>Ω in UTF</p>
  
  <p>UTF-8 (hex) 0xCE 0xA9 (cea9)</p>
  
  <p>UTF-16 (hex)    0x03A9 (03a9)</p>
  
  <p>2 wprintf and printf just cannot be run in the same program, I have
  to choose to use either wprintf or printf, why?</p>
  
  <hr>
  
  <p>See my program:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;wchar.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;locale.h&gt;
  
  int main() {
    setlocale(LC_ALL,""); // inherit locale setting from environment
    int r;
    char wc_char[4] = {0,0,0,0};
    wchar_t myChar1 = L'Ω'; //greek 
  
    // should comment out either wprintf or printf, they don't run together
    r = wprintf(L"char is %lc (%x)\n", myChar1, myChar1);//On Linux, to UTF16
  
    r = wctomb(wc_char, myChar1); // On Linux, to UTF8
    r = printf("r:%d, %x, %x, %x, %x\n", r, wc_char[0], wc_char[1], wc_char[2], wc_char[3]);
  }
  </code></pre>