   wide stream file i/o problem
  It was my understanding that when using wfstream, wifstream and wofstream that it would read the file as two bytes per element. However it appears to still treat the file as Ascii failing on any non ascii chars...Eg I wrote the following code:std::wofstream file(L"test.txt", std::ios::out | std::ios::trunc);file << L"Hello World" << std::endl;file << L"Non ascii chars: \u20AC \u221E" << std::endl;The resulting file contained (in hex):48 65 6C 6C 6F 20 57 6F 72 6C 64 0D 0A 4E 6F 6E 20 61 73 63 69 69 20 63 68 6172 73 3A 20 Rather than a utf-16 output of (think I got it right, but you get the idea):48 00 65 00 6C 00 6C 00 6F 00 20 00 57 00 6F 00 72 00 6C 00 64 00 0D 00 0A 004E 00 6F 00 6E 00 20 00 61 00 73 00 63 00 69 00 69 00 20 00 63 00 68 00 61 0072 00 73 00 3A 00 20 AC 20 00 20 1E 22 0D 0A
  Long story short, wide file output is allowed by the C++ standard to narrow the values when writing to disk. One way to deal with this is to imbue the stream with a custom do nothing code_cvt that doesn't narrow the wchar_t values. You can also just output the values as binary using a narrow stream. I generally recommend the latter.   ;  Ok, how do I do the first way to effect all wide file streams?And as for the second one, doesnt that basically break the << and >> stream operators? Id rather not have to do all the formatting stuff myself using write and read methods. Also if its just the file io wide streams, could I create my own version of wifstream, wofstream and wfstream with boost iostreams with minimal effort, that writes the file as expected (ie not transforming the output to narrow chars for writing)?   