Writing utf16 to file in binary mode
Here we run into the little used locale properties. If you output your string as a string (rather than raw data) you can get the locale to do the appropriate conversion auto-magically. N.B.This code does not take into account edianness of the wchar_t character. #include <locale> #include <fstream> #include <iostream> // See Below for the … Read more