Debian Codegraph @

node/@xterm/xterm/src/common/data/Charsets.ts

raw
1 /**
2 * Copyright (c) 2016 The xterm.js authors. All rights reserved.
3 * @license MIT
4 */
5
6 import { ICharset } from 'common/Types';
7
8 /**
9 * The character sets supported by the terminal. These enable several languages
10 * to be represented within the terminal with only 8-bit encoding. See ISO 2022
11 * for a discussion on character sets. Only VT100 character sets are supported.
12 */
13 export const CHARSETS: { [key: string]: ICharset | undefined } = {};
14
15 /**
16 * The default character set, US.
17 */
18 export const DEFAULT_CHARSET: ICharset | undefined = CHARSETS['B'];
19
20 /**
21 * DEC Special Character and Line Drawing Set.
22 * Reference: http://vt100.net/docs/vt102-ug/table5-13.html
23 * A lot of curses apps use this if they see TERM=xterm.
24 * testing: echo -e '\e(0a\e(B'
25 * The xterm output sometimes seems to conflict with the
26 * reference above. xterm seems in line with the reference
27 * when running vttest however.
28 * The table below now uses xterm's output from vttest.
29 */
30 CHARSETS['0'] = {
31 '`': '\u25c6', // '◆'
32 'a': '\u2592', // '▒'
33 'b': '\u2409', // '␉' (HT)
34 'c': '\u240c', // '␌' (FF)
35 'd': '\u240d', // '␍' (CR)
36 'e': '\u240a', // '␊' (LF)
37 'f': '\u00b0', // '°'
38 'g': '\u00b1', // '±'
39 'h': '\u2424', // '␤' (NL)
40 'i': '\u240b', // '␋' (VT)
41 'j': '\u2518', // '┘'
42 'k': '\u2510', // '┐'
43 'l': '\u250c', // '┌'
44 'm': '\u2514', // '└'
45 'n': '\u253c', // '┼'
46 'o': '\u23ba', // '⎺'
47 'p': '\u23bb', // '⎻'
48 'q': '\u2500', // '─'
49 'r': '\u23bc', // '⎼'
50 's': '\u23bd', // '⎽'
51 't': '\u251c', // '├'
52 'u': '\u2524', // '┤'
53 'v': '\u2534', // '┴'
54 'w': '\u252c', // '┬'
55 'x': '\u2502', // '│'
56 'y': '\u2264', // '≤'
57 'z': '\u2265', // '≥'
58 '{': '\u03c0', // 'π'
59 '|': '\u2260', // '≠'
60 '}': '\u00a3', // '£'
61 '~': '\u00b7' // '·'
62 };
63
64 /**
65 * British character set
66 * ESC (A
67 * Reference: http://vt100.net/docs/vt220-rm/table2-5.html
68 */
69 CHARSETS['A'] = {
70 '#': '£'
71 };
72
73 /**
74 * United States character set
75 * ESC (B
76 */
77 CHARSETS['B'] = undefined;
78
79 /**
80 * Dutch character set
81 * ESC (4
82 * Reference: http://vt100.net/docs/vt220-rm/table2-6.html
83 */
84 CHARSETS['4'] = {
85 '#': '£',
86 '@': '¾',
87 '[': 'ij',
88 '\\': '½',
89 ']': '|',
90 '{': '¨',
91 '|': 'f',
92 '}': '¼',
93 '~': '´'
94 };
95
96 /**
97 * Finnish character set
98 * ESC (C or ESC (5
99 * Reference: http://vt100.net/docs/vt220-rm/table2-7.html
100 */
101 CHARSETS['C'] =
102 CHARSETS['5'] = {
103 '[': 'Ä',
104 '\\': 'Ö',
105 ']': 'Å',
106 '^': 'Ü',
107 '`': 'é',
108 '{': 'ä',
109 '|': 'ö',
110 '}': 'å',
111 '~': 'ü'
112 };
113
114 /**
115 * French character set
116 * ESC (R
117 * Reference: http://vt100.net/docs/vt220-rm/table2-8.html
118 */
119 CHARSETS['R'] = {
120 '#': '£',
121 '@': 'à',
122 '[': '°',
123 '\\': 'ç',
124 ']': '§',
125 '{': 'é',
126 '|': 'ù',
127 '}': 'è',
128 '~': '¨'
129 };
130
131 /**
132 * French Canadian character set
133 * ESC (Q
134 * Reference: http://vt100.net/docs/vt220-rm/table2-9.html
135 */
136 CHARSETS['Q'] = {
137 '@': 'à',
138 '[': 'â',
139 '\\': 'ç',
140 ']': 'ê',
141 '^': 'î',
142 '`': 'ô',
143 '{': 'é',
144 '|': 'ù',
145 '}': 'è',
146 '~': 'û'
147 };
148
149 /**
150 * German character set
151 * ESC (K
152 * Reference: http://vt100.net/docs/vt220-rm/table2-10.html
153 */
154 CHARSETS['K'] = {
155 '@': '§',
156 '[': 'Ä',
157 '\\': 'Ö',
158 ']': 'Ü',
159 '{': 'ä',
160 '|': 'ö',
161 '}': 'ü',
162 '~': 'ß'
163 };
164
165 /**
166 * Italian character set
167 * ESC (Y
168 * Reference: http://vt100.net/docs/vt220-rm/table2-11.html
169 */
170 CHARSETS['Y'] = {
171 '#': '£',
172 '@': '§',
173 '[': '°',
174 '\\': 'ç',
175 ']': 'é',
176 '`': 'ù',
177 '{': 'à',
178 '|': 'ò',
179 '}': 'è',
180 '~': 'ì'
181 };
182
183 /**
184 * Norwegian/Danish character set
185 * ESC (E or ESC (6
186 * Reference: http://vt100.net/docs/vt220-rm/table2-12.html
187 */
188 CHARSETS['E'] =
189 CHARSETS['6'] = {
190 '@': 'Ä',
191 '[': 'Æ',
192 '\\': 'Ø',
193 ']': 'Å',
194 '^': 'Ü',
195 '`': 'ä',
196 '{': 'æ',
197 '|': 'ø',
198 '}': 'å',
199 '~': 'ü'
200 };
201
202 /**
203 * Spanish character set
204 * ESC (Z
205 * Reference: http://vt100.net/docs/vt220-rm/table2-13.html
206 */
207 CHARSETS['Z'] = {
208 '#': '£',
209 '@': '§',
210 '[': '¡',
211 '\\': 'Ñ',
212 ']': '¿',
213 '{': '°',
214 '|': 'ñ',
215 '}': 'ç'
216 };
217
218 /**
219 * Swedish character set
220 * ESC (H or ESC (7
221 * Reference: http://vt100.net/docs/vt220-rm/table2-14.html
222 */
223 CHARSETS['H'] =
224 CHARSETS['7'] = {
225 '@': 'É',
226 '[': 'Ä',
227 '\\': 'Ö',
228 ']': 'Å',
229 '^': 'Ü',
230 '`': 'é',
231 '{': 'ä',
232 '|': 'ö',
233 '}': 'å',
234 '~': 'ü'
235 };
236
237 /**
238 * Swiss character set
239 * ESC (=
240 * Reference: http://vt100.net/docs/vt220-rm/table2-15.html
241 */
242 CHARSETS['='] = {
243 '#': 'ù',
244 '@': 'à',
245 '[': 'é',
246 '\\': 'ç',
247 ']': 'ê',
248 '^': 'î',
249 // eslint-disable-next-line @typescript-eslint/naming-convention
250 '_': 'è',
251 '`': 'ô',
252 '{': 'ä',
253 '|': 'ö',
254 '}': 'ü',
255 '~': 'û'
256 };