文件名称:unicode_program
介绍说明--下载内容均来自于网络,请自行研究使用
unicode编程的各种知识
GBK->Unicode的,直接根据编码对应放置相应的转换后编码才是,直接通过计算就可以定位,何苦还二分法...
LZ的表格查起来得多慢呀...不敢想像
==============================
附转换函数如下
-unicode program
u16 gbk2uni(u8 c1,u8 c2)
{
return (c1>=0x81 && c1<=0xfe) && (c2>=0x40 && c2<=0xfe)
?
*( mb_gb2uni_table+ (c1-0x81)*0xbf+ c2-0x40 ) :
0x1fff
}
==============================
//const u32 mb_gb2uni_size = 24066
u16* const mb_gb2uni_table = (u16*)
"\x02\x4e\x04\x4e\x05\x4e\x06\x4e\x0f\x4e\x12\x4e\x17\x4e\x1f\x4e\x20\x4e\x21\x4e\x23\x4e\x26\x4e\x29\x4e\x2e\x4e\x2f\x4e\x31\x4e"
"\x33\x4e\x35\x4e\x37\x4e\x3c\x4e\x40\x4e\x41\x4e\x42\x4e\x44\x4e\x46\x4e\x4a\x4e\x51\x4e\x55\x4e\x57\x4e\x5a\x4e\x5b\x4e\x62\x4e"
GBK->Unicode的,直接根据编码对应放置相应的转换后编码才是,直接通过计算就可以定位,何苦还二分法...
LZ的表格查起来得多慢呀...不敢想像
==============================
附转换函数如下
-unicode program
u16 gbk2uni(u8 c1,u8 c2)
{
return (c1>=0x81 && c1<=0xfe) && (c2>=0x40 && c2<=0xfe)
?
*( mb_gb2uni_table+ (c1-0x81)*0xbf+ c2-0x40 ) :
0x1fff
}
==============================
//const u32 mb_gb2uni_size = 24066
u16* const mb_gb2uni_table = (u16*)
"\x02\x4e\x04\x4e\x05\x4e\x06\x4e\x0f\x4e\x12\x4e\x17\x4e\x1f\x4e\x20\x4e\x21\x4e\x23\x4e\x26\x4e\x29\x4e\x2e\x4e\x2f\x4e\x31\x4e"
"\x33\x4e\x35\x4e\x37\x4e\x3c\x4e\x40\x4e\x41\x4e\x42\x4e\x44\x4e\x46\x4e\x4a\x4e\x51\x4e\x55\x4e\x57\x4e\x5a\x4e\x5b\x4e\x62\x4e"
(系统自动生成,下载前可以参看下载内容)
下载文件列表
unicode_program.doc