cloud

  C++博客 :: 首页 :: 联系 :: 聚合  :: 管理
  29 Posts :: 1 Stories :: 4 Comments :: 0 Trackbacks

常用链接

留言簿(5)

我参与的团队

搜索

  •  

最新评论

阅读排行榜

评论排行榜

int UTF8toUTF16(int c)
{
    signed 
char *t=(signed char*)&c;
    
int ret=*&(0x0f | ((*t>>1&0x1f| ~(*t>>7));
    
int i;
    assert ((
*& 0xc0!= 0x80);
    
for (i=1;i<3;i++) {
        
if ((t[i] & 0xc0)!=0x80) {
            
break;
        }
        ret
=ret<<6 | (t[i] & 0x3f);
    }
    
return ret;
}
posted on 2007-05-11 12:02 cloud 阅读(514) 评论(0)  编辑 收藏 引用

只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理