title: Can't read a UTF8 encoded file using fopen(file, "r,ccs=UTF-8")
body: <p>I'm using ccs=encoding (as described in <a href="http://msdn.microsoft.com/en-us/library/yeby3zcb%28v=vs.80%29.aspx" rel="nofollow">MSDN</a>) to set the encoding to UTF-8 when opening a file with fopen.</p>
  
  <p>When writing to a file it works fine</p>
  
  <pre><code>wchar_t* unicode_text = L"こんにちは";
  FILE* f = fopen("C:\\test.txt", "w,ccs=UTF-8");
  fwprintf(f, L"%s\n", unicode_text);
  fclose(f);
  </code></pre>
  
  <p>When I open the file in a text editor the unicode shows as it should.
  But when trying to read from the created file the UTF-8 encoding is not detected:</p>
  
  <pre><code>wchar_t buffer[1000];
  FILE* f = fopen("C:\\test.txt", "r,ccs=UTF-8");
  fgetws(buffer, 1000, f);
  fclose(f);
  
  MessageBoxW(0, buffer, 0, 0);
  </code></pre>
  
  <p>This shows "ï»¿ããã«ã¡ã¯" in the message box.</p>
  
  <p>Why does this happen? Is ccs=UTF-8 only valid when opening files for writing?</p>