I got seperated parts from 22 files in different languages and made them a wstring line like:
wstring wstr_line = L"\"IDS_TOAST_ECOON\",\"eco Mode is turned On.\",\"ecoモードをオンにしました。\",\"Režim eco je zapnutý.\",\"Økoindstillingen er aktiveret\"..."
I used wofstream to put wstr_line into a file, but the line finished at Japanese part(\"ecoモードをオンにしました。\").
If I set wfout.imbue("chs");
the line finished at Czech part(\"Režim eco je zapnutý.\")
How can write this line to a file correctly?
Try sticking this as the first line in your code:
This sets the local of the application to what the machine supports (which is probably UTF-32 for wide character strings). Unfortunately the default local is "C" for programers and the codecvt facet for the "C" local does not do anything useful (probably truncates wide charters to a single byte without conversion).