- 注册时间
- 2006-2-26
- 最后登录
- 2008-10-24
⑥精研
- 积分
- 2470
|
看过下代码,里面SJIS转UTF16的码表是硬编码进去的。- unsigned short sjis_2_utf16[0xfcfc - 0x8140 + 1];
- static unsigned short sjis_2_utf16_org[][2] = {
- {0x8140,0x3000},
- {0x8141,0x3001},
- {0x8142,0x3002},
- {0x8143,0xff0c},
- {0x8144,0xff0e},
- // 省略10000行……
- void initSJIS2UTF16()
- {
- int i = 0;
- while( sjis_2_utf16_org[i][0] ){
- sjis_2_utf16[sjis_2_utf16_org[i][0] - 0x8140] = sjis_2_utf16_org[i][1];
- i++;
- }
- }
- unsigned short convSJIS2UTF16( unsigned short in )
- {
- return sjis_2_utf16[ in - 0x8140 ];
- }
复制代码 莫非要把GBK/BIG5的也一个个硬编码进去??
请教各位大人,ONS汉化有没有方便点的方法? |
|