Yes JJ,
the only solution seems to be to write an IO subsystem that directly writes to console and allow the use MS or MingW like codepage translation.
A little modification to your code:
#include <stdio.h>
#include <windows.h>
#include <wchar.h>
void __cdecl aprintf(char *format, ...) {
char buff[8192]; //Large enoug? WARNING: not thread safe
va_list va;
va_start(va, format);
_vsnprintf(buff, 8191, format, va);
va_end(va); //For correctness as pointed out by John
//Here we should put translation for codepage...
unsigned long int byteswritten;
WriteFile(GetStdHandle(STD_OUTPUT_HANDLE), buff, strlen(buff), &byteswritten, 0);
}
int main(void)
{
wprintf(L"Unicode print\n");
aprintf("Ansi print");
wprintf(L"\nUnicode again\n");
return 0;
}
Modify message