-
Notifications
You must be signed in to change notification settings - Fork 5
/
charsets.py
executable file
·65 lines (56 loc) · 1.32 KB
/
charsets.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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#!/usr/bin/env python
charsets = [
('DEC Special','0',''),
('ASCII','B',''),
('DEC Technical','>',''),
('DEC Supplemental','%5',''),
('UPSS 94','<',''),
('UPSS 96','<','96'),
('ISO Latin-1','A','96'),
('British','A','nrcs'),
('Dutch','4','nrcs'),
('Finnish','5','nrcs'),
('Finnish','C','nrcs'),
('French','R','nrcs'),
('French Canadian','9','nrcs'),
('French Canadian','Q','nrcs'),
('German','K','nrcs'),
('Italian','Y','nrcs'),
('Norwegian/Danish','6','nrcs'),
('Norwegian/Danish','E','nrcs'),
('Norwegian/Danish','`','nrcs'),
('Portuguese','%6','nrcs'),
('Spanish','Z','nrcs'),
('Swedish','7','nrcs'),
('Swedish','H','nrcs'),
('Swiss','=','nrcs'),
]
def write(s):
import sys
sys.stdout.write(s)
def display(name,id,type):
label = '%s (%s)' % (name,id)
while len(label) < 22: label += ' '
write(label)
write('\x0E')
write('\033)0')
if type == '96':
write('\033-%s' % id)
else:
write('\033)%s' % id)
write('_#@[\\]^\x7F`{|}\x7F~')
write('\x0F\n')
write('\033[?42h')
write('\033[2J\033[H')
write('\033[40COther\n\n')
for name,id,type in charsets:
if type == 'nrcs': continue
write('\033[40C')
display(name,id,type)
write('\033[H')
write('NRCS\n\n')
for name,id,type in charsets:
if type != 'nrcs': continue
display(name,id,type)
write('\n')
write('\033[?42l')