Win32 API

Notes on Win32 API

ini file

ini file has two type that is classified by character code, ACP (Shift_JIS in Japanese) and Unicode (UTF-16 with LE BOM).
And there are two version Win32 APIs for read/write ini file. ANSI version (GetPrivateProfileStringA, WritePrivateProfileStringA etc) with char * arguments, and wide character version (GetPrivateProfileStringW, WritePrivateProfileStringW etc) with wchar_t * arguments.
Combination of ini file (ACP, Unicode) and API (ANSI version, wide character version) makes 4 patterns.

If Windows 2000 or later, conversion is automatically performed inside API, fit to character code of ini file.

If Windows NT 4, "ANSI API and ACP ini file" and "wide character API and ACP ini file" combination will works fine.
When Wide character API read/write a ACP ini file, conversion is automatically performed.

If Windows 95, 98, Me, only "ANSI API and ACP ini file" combination will works fine.
Automatically conversion does not seem to be work.

Windows 2000- Windows NT 4 Windows 95, 98, Me
ANSI API Wide API ANSI API Wide API ANSI API Wide API
ACP ini file OK OK OK OK OK NG
Unicode (UTF-16LE) ini file OK OK NG NG NG NG