С cat'ом - в сад. Написано же СИ!
Protopopulus,
увы, садись, два.
#include <stdlib.h>
#include <locale.h>
#include <stdio.h>
#include <wchar.h>
int main(int argc, char** argv)
{
/* Ставим текущую локаль заданную переменными окружения LANG и LC_* */
setlocale(LC_ALL, "");
const wchar_t *wstr1 = L"Привет, мир!";
const wchar_t *wstr2 = L"Hello, world!";
FILE *fp = fopen("test.txt", "w+");
fwprintf(fp, L"%S\n", wstr1);
fwprintf(fp, L"%S\n", wstr2);
fclose(fp);
return (EXIT_SUCCESS);
}