title: c++ wofstream issue in unicode program
body: <p>Using unicode compile in vs2008
  How do you output many language characters to a file in C++ with wofstream?</p>
  
  <p>I can do it in C code no problem e.g.</p>
  
  <pre><code> FILE *out;
   if( (out  = _wfopen( L"test.txt", L"wb" )) != NULL )
   {
       fwprintf(out,L"test\r\n");
       fwprintf(out,L"наказание\r\n");
       fwprintf(out,L"ウェブ全体から検索\r\n");
   }
  </code></pre>
  
  <p>when I open the file it's all correct, but with below C++ program all I get is the first line and I have tried locale::global(locale("")); with same result.</p>
  
  <pre><code> wofstream MyOutputStream(L"test.txt"); 
   if(!MyOutputStream)
   {
      AfxMessageBox(L"Error opening file");
      return;
   }
  
      MyOutputStream &lt;&lt; L"test\r\n";
      MyOutputStream &lt;&lt; L"наказание\r\n";
      MyOutputStream &lt;&lt; L"ウェブ全体から検索\r\n";
  
      MyOutputStream.close();
  </code></pre>
  
  <p>and I have tried inserting this with same result:-</p>
  
  <pre><code>  std::locale mylocale(""); 
    MyOutputStream.imbue(mylocale);
  </code></pre>