What has happened to wide char printf single characters? VS10 & MCBS:
#include<stdio.h>
#include <windows.h>
int const maxPathFolder = MAX_PATH - 3;
wchar_t const *delims = L"T";
wchar_t *testString = L"Codepage is: ";
int main()
{
FILE *stream = NULL;
UINT CP = GetConsoleOutputCP();
wchar_t *testName= (wchar_t *)calloc(maxPathFolder, sizeof(wchar_t));
wcscat_s(testName, maxPathFolder, L"C:\\printemp.txt");
stream = _wfopen(testName, L"w");
if (fwprintf(stream, L"%s%i%c", testString, CP, delims) == EOF) wprintf(L"Problems writing to File.");
fclose (stream);
swprintf (testName, L"%s%i%c", testString, CP, delims);
free (testName);
}
The output in printemp.txt is Codepage is: 850?
and the delims variable in swprintf'd testName
is the Han character 坠. According to Igor's comments in this post, wide streams looked a little broken.
The aim ultimately is to output to file arrays of wide char to file separated by a delimiter. Some way around it?