Testing msvcr90.dll with PellesC how unicode works with it.
//#include <stdio.h>
#include <wchar.h>
// msvcrxx.h
#define MSVCRXX
#ifdef MSVCRXX
#pragma nodefaultlib
#pragma comment(lib, "msvcr90.lib")
#pragma comment(linker, "/MANIFESTDEPENDENCY:\"type='win32' name='Microsoft.VC90.CRT' version='9.0.21022.8' processorArchitecture='x86' publicKeyToken='1fc8b3b9a1e18e3b'\"")
typedef struct FAKEFILE {
char fake[0x20];
} FILE;
//__declspec(dllimport) extern FAKEFILE * __cdecl __iob_func(void);
__declspec(dllimport) extern FILE * __cdecl __iob_func(void);
#undef stdin
#define stdin (struct FILE*)(&__iob_func()[0])
#undef stdout
#define stdout (struct FILE*)(&__iob_func()[1])
#undef stderr
#define stderr (struct FILE*)(&__iob_func()[2])
#endif
__declspec(dllimport) extern int _setmode(int handle, int mode);
__declspec(dllimport) extern int _fileno(struct FILE * stream);
//int _stdcall SetConsoleOutputCP(unsigned int wCodePageID);
int __cdecl mainCRTStartup(void)
//int main(int argc, char **argv)
{
_setmode(_fileno(stdout), 0x20000); // set console mode to unicode
//SetConsoleOutputCP(1252); // Windows-1252
wprintf(L"wprintf ÄäÖöÅå\n");
fwprintf(stdout, L"stdout ÄäÖöÅå\n");
fwprintf(stderr, L"stderr ÄäÖöÅå\n");
return 0;
}
msvcr90.defLIBRARY msvcr90.dll
EXPORTS
__iob_func
__set_app_type
_fileno
_setmode
wprintf
fwprintf