这代码看不懂!!
void TruncateChineseWithLength (char *pi_stSource, int pi_inLength, char *po_stResult)
{
int inIndex=0;
int inCount=0;
char strResult[MAXBUFFLEN *2];
char temp[3];
//memset (po_stResult, 0x00, strlen(pi_stSource));
strResult [0] = 0x00;
for(inIndex=0;inIndex<strlen(pi_stSource);inIndex++)
{
if((pi_stSource[inIndex] & 0x00000080) == 0x00000080)
{
if (inCount < (pi_inLength - 1))
{
strResult[inCount++]=pi_stSource[inIndex];
inIndex++;
strResult[inCount++]=pi_stSource[inIndex];
}
}
else
{
if (inCount < (pi_inLength))
{
strResult[inCount++]=pi_stSource[inIndex];
}
}
}
strResult[inCount] = 0x00;
memset (po_stResult, 0x00, strlen(strResult));
strcpy (po_stResult, strResult);
}
这代码看不懂!!