James
In the case of ObjReader, the .MTL, the .OBJ, and the WinLIFT .SKS are always plain ASCII files.
However the C++ source code itself for ObjReader, GDImage, and WinLIFT is full UNICODE.
For example all GDIPLUS code is always using UNICODE while the deprecated GDI32 is still ANSI.
All file IO are based on the core API fscanf to read formatted data from stream.
And CreateFile to read from texture files.
However, remember that in C++ CreateFile is indeed CreateFileW when defined for UNICODE, and CreateFileA for ASCII.
And i am using MultiByteToWideChar to convert from ASCII to UNICODE (see the code below).
hFile = CreateFile(zPath, GENERIC_READ, 0, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
memset(&zPath[0], 0, sizeof(WCHAR) * MAX_PATH);
if (hFile != INVALID_HANDLE_VALUE) {
DWORD dwBytes = 0;
BYTE* buffer = new BYTE[nSize];
if (ReadFile(hFile, &buffer[0], nSize, &dwBytes, NULL)) {
MultiByteToWideChar(CP_ACP, 0, (LPCSTR) &buffer[0], nSize, zPath, MAX_PATH);
wcsncat_s(zMessage, zPath, _TRUNCATE);
}
delete [] buffer;
CloseHandle(hFile);
}
...