str2HZ(hz)
char *hz;
{
int i;
int j=0;
char qjhz[200];
memset(qjhz,0,sizeof(qjhz));
for(i=0;hz[i]!='\0';)
{
if(hz[i]&0x80)
{
qjhz[j++]=hz[i++];
qjhz[j++]=hz[i++];
}
else
{
if(hz[i] < 0x20)
{
i++;
continue;
}
else if(hz[i]==0x20)
{
qjhz[j++]=0xa1;
qjhz[j++]=0xa1;
i++;
}
else
{
qjhz[j++]=0xa3;
qjhz[j++]=hz[i++] + 0x80;
}
}
}
qjhz[j]='\0';
strcpy(hz,qjhz);
return(j);
}
阅读(1393) | 评论(0) | 转发(0) |