MatCNomt.blog.chinaunix.net
bedreaming
全部博文(132)
2012年(18)
2011年(35)
2010年(60)
2009年(19)
金色の闪
soofun
小雅贝贝
owinux
xd_vito
GFree_Wi
libingji
格伯纳
浪花小雨
jiaojina
changdin
tangc198
robot_sq
hz5034
qjpoo
分类: LINUX
2010-02-09 13:45:45
UTF82Unicode(const unsigned char* ib, int & iLen, unsigned char* ob,int &n) { n=0; for(int i=0; i<iLen; i++) { if(ib[i]>>7==0) { ob[n++]=ib[i]; ob[n++]=0; } else if(ib[i]>=240) { unsigned short x=ib[i]&0xF; x<<=6; x|=ib[i+1]&0x3F; x<<=6; x|=ib[i+2]&0x3f; x<<=6; x|=ib[i+3]&0x3f; ob[n++]=x&0xFF; ob[n++]=(x>>8)&0xFF; i+=3; } else if(ib[i]>=224) { unsigned short x=ib[i]&0xF; x<<=6; x|=ib[i+1]&0x3F; x<<=6; x|=ib[i+2]&0x3F; ob[n++]=x&0xFF; ob[n++]=(x>>8)&0xFF; i+=2; } else if(ib[i]>=192) { unsigned short x=ib[i]&0x3F; x<<=6; x|=ib[i+1]&0x3F; ob[n++]=x&0xFF; ob[n++]=(x>>8)&0xFF; i++; } } n = n/2; }
上一篇:fc12的声音问题
下一篇:一本好书:How to Think Like a Computer Scientist
登录 注册