int SmsDecode7bit(const unsigned char* pSrc, char* pDst, int nSrcLength)
{
int nSrc;
int nDst;
int nByte;
unsigned char nLeft;
nSrc = 0;
nDst = 0;
nByte = 0;
nLeft = 0;
while(nSrc
{
*pDst = ((*pSrc << nByte) | nLeft) & 0x7f;
nLeft = *pSrc >> (7-nByte);
pDst++;
nDst++;
nByte++;
if(nByte == 7)
{
*pDst = nLeft;
pDst++;
nDst++;
nByte = 0;
nLeft = 0;
}
pSrc++;
nSrc++;
}
*pDst = '\0';
return nDst;
}
阅读(565) | 评论(0) | 转发(0) |