有关unicode和gb2312转换
char* UnicodeToGB2312(const wchar_t* szUnicodeString)
{
UINT nCodePage = 936; //GB2312
int nLength=WideCharToMultiByte(nCodePage,0,szUnicodeString,-1,NULL,0,NULL,NULL);
char* pBuffer=new char[nLength+1];
WideCharToMultiByte(nCodePage,0,szUnicodeString,-1,pBuffer,nLength,NULL,NULL);
pBuffer[nLength]=0;
return pBuffer;
}
网上找到一个函数,用于将unicode转换为gb2312
这个函数在纯英文环境下能执行吗?
unicode到gb2312的转换应该要通过一个转换表来进行,这个转换表是不是已经包含在windows操作系统中了?
我在控制面板中的语言区域选项中看到了一个“代码页转换表”,其中很多选项,有些前面打上了勾,有些没有。是否打勾会影响到这个函数的运行吗?英文环境下呢?
请大家指点一下!