读写ini配置文件中的简体中文(支持GB2312、GBK和GB18030编码)
读写ini文件的标准API是GetPrivateProfileString和WritePrivateProfileString,但它们只支持读写UTF-16编码的内容,读取.INI文件可能会出现中文乱码问题。 这个DLL提供支持读取写ini文件中简体中文内容的功能,c语言原型如下: BOOL WINAPI GetProfileGb18030String(const wchar_t* filename, const wchar_t *section, const wchar_t *key, wchar_t *resultstr, size_t result_maxlength); BOOL WINAPI SetProfileGb18030String(const wchar_t* filename, const wchar_t *section, const wchar_t *key, const wchar_t *value); 第一个函数resultstr参数指向接收缓冲区(已经在外部分配好了空间),result_maxlength是缓冲区最大字节空间大小。