📄 gb2uni.h
字号:
#ifndef _GB2UNI_H
#define _GB2UNI_H
#define GB_TOTAL_CHAR 7445
#define GB_TOTAL_GROUP_NUM 86
//#define GB_12345
/*************************************************************
Function: getGBUniMapIndex
Description:
calculate the map index from a gb code
Input:
msb - the most significant byte of the gb char
lsb - the least significant byte of the gb char
Output:
the index
-1 if code error
**************************************************************/
int getGBUniMapIndex(unsigned char msb, unsigned char lsb);
/*************************************************************
Function: gb_to_unicode
Description:
calculate the map index from a big5 code
Input:
bmsb - the most significant byte of the big5 char
blsb - the least significant byte of the big5 char
Output:
umsb - the most significant byte of the unicode char
ulsb - the least significant byte of the unicode char
both umsb and ulsb will be 0 in case of error or umapped
big5 char
**************************************************************/
void gb_to_unicode(unsigned char bmsb, unsigned char blsb, unsigned char *umsb, unsigned char *ulsb);
/*************************************************************
Function: gb_to_unicode_MSB
Description:
get the MSB of the unicode translated from a big5 code
Input:
bmsb - the most significant byte of the big5 char
blsb - the least significant byte of the big5 char
Output:
the MSB of the unicode
**************************************************************/
unsigned char gb_to_unicode_MSB(unsigned char bmsb, unsigned char blsb);
/*************************************************************
Function: big5_to_unicode_LSB
Description:
get the LSB of the unicode translated from a big5 code
Input:
bmsb - the most significant byte of the big5 char
blsb - the least significant byte of the big5 char
Output:
the LSB of the unicode
**************************************************************/
unsigned char gb_to_unicode_LSB(unsigned char bmsb, unsigned char blsb);
/*************************************************************
Function: unicode_to_big5
Description:
translate unicode to big5
Input:
umsb - the most significant byte of the unicode char
ulsb - the least significant byte of the unicode char
Output:
bmsb - the most significant byte of the big5 char
blsb - the least significant byte of the big5 char
both bmsb and blsb will be 0 in case of error or umapped
unicode char
**************************************************************/
void unicode_to_gb(unsigned char umsb, unsigned char ulsb, unsigned char *bmsb, unsigned char *blsb);
/*************************************************************
Function: unicode_to_gb_MSB
Description:
get the MSB of the big5 translated from unicode
Input:
umsb - the most significant byte of the unicode char
ulsb - the least significant byte of the unicode char
Output:
the MSB of the big5
**************************************************************/
unsigned char unicode_to_gb_MSB(unsigned char umsb, unsigned char ulsb);
/*************************************************************
Function: unicode_to_gb_LSB
Description:
get the LSB of the big5 translated from unicode
Input:
umsb - the most significant byte of the unicode char
ulsb - the least significant byte of the unicode char
Output:
the LSB of the big5
**************************************************************/
unsigned char unicode_to_gb_LSB(unsigned char umsb, unsigned char ulsb);
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -