c 中文判别

c 中文判别

int i = 0;
char* point = NULL;
for(i = 20; i < strlen(pString->content) ; i++)
{
if((pString->content[i] >= 0x30 && pString->content[i] <= 0x39) || (pString->content[i] >= 0x41 && pString->content[i] <= 0x5a) || (pString->content[i] >= 0x61 && pString->content[i] <= 0x7a) || (pString->content[i] >= 0xa1 && pString->content[i] <= 0xfe))
{
//point = &pString->content[i];
point = (char*)malloc(2*strlen(pString->content+i)+1);
Substitute(pString
->content+i, point, " ", "" );
//point = delete_space(point);

int* p_n_change= (int*)malloc(sizeof(int));
p_n_change[
2] = pString->content[i+150];
p_n_change[
1] = pString->content[i+149];
p_n_change[
0] = pString->content[i+148];
p_n_change[
3] = '\0';

free(desStr);
desStr
= NULL;
if((pString->content[i+148] >= 0xa1 && pString->content[i+148] <= 0xfe))
{
pString
->content[i+148] ='\0';
}
if((pString->content[i+149] >= 0xa1 && pString->content[i+149] <= 0xfe))
{
pString
->content[i+149] ='\0';
}
pString
->content[i+150] ='\0';
break;
}
}

posted @ 2011-06-21 10:33  wangkangluo1  阅读(173)  评论(0编辑  收藏  举报