Question

I've a non-unicode application which is using unicode versions of the ini reading functions like GetPrivateProfileSectionW and GetPrivateProfileStringW. The program is working well when "Language for non-unicode programs" is set to English.

When I change this setting to Chinese (PRC), the functions GetPrivateProfileSectionW and GetPrivateProfileStringW return null.

I must keep this setting at Chinese, because when English is selected for "Language for non-unicode programs", CComBSTR.LoadString is not working as expected, it loads the Chinese characters in a resource DLL as question marks.

Any ideas?

Thanks.

Was it helpful?

Solution

Michael Kaplan explains. The solution is to use Unicode INI files, which don't depend on the "Language for non-unicode programs".

OTHER TIPS

The "Language for non-Unicode programs" also selects the default code page used for files. US English is usually Windows-1252. Chinese will be something different, like GB2312 or GBK. Open your .INI file with Notepad and save it with the "ANSI" format, which will be whatever Microsoft's default for the non-Unicode language selected.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top