-
Notifications
You must be signed in to change notification settings - Fork 2
/
chinese.py
26 lines (26 loc) · 1.09 KB
/
chinese.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
class CN_UTF8:
"""docstring for CN_UTF8"""
#key:values
#key: 使用汉字的UTF-8码
#values: 16*16
# [0] 8*16 上半部分
# [1] 8*16 下半部分
UTF8_CHINESE = {
0xe789a9:[
[0x40,0x3C,0x10,0xFF,0x10,0x10,0x20,0x10,0x8F,0x78,0x08,0xF8,0x08,0xF8,0x00,0x00],
[0x02,0x06,0x02,0xFF,0x01,0x01,0x04,0x42,0x21,0x18,0x46,0x81,0x40,0x3F,0x00,0x00]
],#物
0xe88194:[
[0x02,0xFE,0x92,0x92,0xFE,0x02,0x00,0x10,0x11,0x16,0xF0,0x14,0x13,0x10,0x00,0x00],
[0x10,0x1F,0x08,0x08,0xFF,0x04,0x81,0x41,0x31,0x0D,0x03,0x0D,0x31,0x41,0x81,0x00]
],#联
0xe7bd91:[
[0x00,0xFE,0x02,0x22,0x42,0x82,0x72,0x02,0x22,0x42,0x82,0x72,0x02,0xFE,0x00,0x00],
[0x00,0xFF,0x10,0x08,0x06,0x01,0x0E,0x10,0x08,0x06,0x01,0x4E,0x80,0x7F,0x00,0x00]
],#网
}
#key 汉字的UTF-8码
#isBottom 确定这次是获取 某个字的 上半部分(0) 还是下半部分(1)
def get_chinese_utf8(self, key,isBottom = 0):
values = self.UTF8_CHINESE[key]
return values[isBottom]