//GBK 2 UTF8
int API_Gbk2Utf8(const char *szSource, string &strDest)
{
char szUniString[strlen(szSource)*2];
int iLen = string_gbk2unicode(szSource, szUniString, strlen(szSource));
unsigned char pTemp[4] = {0};
unsigned short iTemp;
char *pUTFString = (char *)malloc(sizeof(szUniString) *2+1);
int pos=0;
for (int i=0; i
{
iTemp =(((unsigned char)szUniString[i])<<8) + (szUniString[i+1] & 0xff);
i++;
int len= UCS2toUTF8Code(iTemp, pTemp);
if (0 == len)
{
return -1;
}else{
memcpy((void*)(pUTFString+pos),(const void*)pTemp,len);
pos+=len;
}
memset(pTemp , 0 ,sizeof(pTemp));
}
pUTFString[pos]='\0';
strDest = pUTFStrin