aboutsummaryrefslogtreecommitdiffstats
path: root/node_modules/xterm/src/common/data/Charsets.ts
blob: c72d5a237f1d2523cb9cbe8b0592b0723e03702e (plain)
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
/**
 * Copyright (c) 2016 The xterm.js authors. All rights reserved.
 * @license MIT
 */

import { ICharset } from 'common/Types';

/**
 * The character sets supported by the terminal. These enable several languages
 * to be represented within the terminal with only 8-bit encoding. See ISO 2022
 * for a discussion on character sets. Only VT100 character sets are supported.
 */
export const CHARSETS: { [key: string]: ICharset | undefined } = {};

/**
 * The default character set, US.
 */
export const DEFAULT_CHARSET: ICharset | undefined = CHARSETS['B'];

/**
 * DEC Special Character and Line Drawing Set.
 * Reference: http://vt100.net/docs/vt102-ug/table5-13.html
 * A lot of curses apps use this if they see TERM=xterm.
 * testing: echo -e '\e(0a\e(B'
 * The xterm output sometimes seems to conflict with the
 * reference above. xterm seems in line with the reference
 * when running vttest however.
 * The table below now uses xterm's output from vttest.
 */
CHARSETS['0'] = {
  '`': '\u25c6', // '◆'
  'a': '\u2592', // '▒'
  'b': '\u2409', // '␉' (HT)
  'c': '\u240c', // '␌' (FF)
  'd': '\u240d', // '␍' (CR)
  'e': '\u240a', // '␊' (LF)
  'f': '\u00b0', // '°'
  'g': '\u00b1', // '±'
  'h': '\u2424', // '␤' (NL)
  'i': '\u240b', // '␋' (VT)
  'j': '\u2518', // '┘'
  'k': '\u2510', // '┐'
  'l': '\u250c', // '┌'
  'm': '\u2514', // '└'
  'n': '\u253c', // '┼'
  'o': '\u23ba', // '⎺'
  'p': '\u23bb', // '⎻'
  'q': '\u2500', // '─'
  'r': '\u23bc', // '⎼'
  's': '\u23bd', // '⎽'
  't': '\u251c', // '├'
  'u': '\u2524', // '┤'
  'v': '\u2534', // '┴'
  'w': '\u252c', // '┬'
  'x': '\u2502', // '│'
  'y': '\u2264', // '≤'
  'z': '\u2265', // '≥'
  '{': '\u03c0', // 'π'
  '|': '\u2260', // '≠'
  '}': '\u00a3', // '£'
  '~': '\u00b7'  // '·'
};

/**
 * British character set
 * ESC (A
 * Reference: http://vt100.net/docs/vt220-rm/table2-5.html
 */
CHARSETS['A'] = {
  '#': '£'
};

/**
 * United States character set
 * ESC (B
 */
CHARSETS['B'] = undefined;

/**
 * Dutch character set
 * ESC (4
 * Reference: http://vt100.net/docs/vt220-rm/table2-6.html
 */
CHARSETS['4'] = {
  '#': '£',
  '@': '¾',
  '[': 'ij',
  '\\': '½',
  ']': '|',
  '{': '¨',
  '|': 'f',
  '}': '¼',
  '~': '´'
};

/**
 * Finnish character set
 * ESC (C or ESC (5
 * Reference: http://vt100.net/docs/vt220-rm/table2-7.html
 */
CHARSETS['C'] =
CHARSETS['5'] = {
  '[': 'Ä',
  '\\': 'Ö',
  ']': 'Å',
  '^': 'Ü',
  '`': 'é',
  '{': 'ä',
  '|': 'ö',
  '}': 'å',
  '~': 'ü'
};

/**
 * French character set
 * ESC (R
 * Reference: http://vt100.net/docs/vt220-rm/table2-8.html
 */
CHARSETS['R'] = {
  '#': '£',
  '@': 'à',
  '[': '°',
  '\\': 'ç',
  ']': '§',
  '{': 'é',
  '|': 'ù',
  '}': 'è',
  '~': '¨'
};

/**
 * French Canadian character set
 * ESC (Q
 * Reference: http://vt100.net/docs/vt220-rm/table2-9.html
 */
CHARSETS['Q'] = {
  '@': 'à',
  '[': 'â',
  '\\': 'ç',
  ']': 'ê',
  '^': 'î',
  '`': 'ô',
  '{': 'é',
  '|': 'ù',
  '}': 'è',
  '~': 'û'
};

/**
 * German character set
 * ESC (K
 * Reference: http://vt100.net/docs/vt220-rm/table2-10.html
 */
CHARSETS['K'] = {
  '@': '§',
  '[': 'Ä',
  '\\': 'Ö',
  ']': 'Ü',
  '{': 'ä',
  '|': 'ö',
  '}': 'ü',
  '~': 'ß'
};

/**
 * Italian character set
 * ESC (Y
 * Reference: http://vt100.net/docs/vt220-rm/table2-11.html
 */
CHARSETS['Y'] = {
  '#': '£',
  '@': '§',
  '[': '°',
  '\\': 'ç',
  ']': 'é',
  '`': 'ù',
  '{': 'à',
  '|': 'ò',
  '}': 'è',
  '~': 'ì'
};

/**
 * Norwegian/Danish character set
 * ESC (E or ESC (6
 * Reference: http://vt100.net/docs/vt220-rm/table2-12.html
 */
CHARSETS['E'] =
CHARSETS['6'] = {
  '@': 'Ä',
  '[': 'Æ',
  '\\': 'Ø',
  ']': 'Å',
  '^': 'Ü',
  '`': 'ä',
  '{': 'æ',
  '|': 'ø',
  '}': 'å',
  '~': 'ü'
};

/**
 * Spanish character set
 * ESC (Z
 * Reference: http://vt100.net/docs/vt220-rm/table2-13.html
 */
CHARSETS['Z'] = {
  '#': '£',
  '@': '§',
  '[': '¡',
  '\\': 'Ñ',
  ']': '¿',
  '{': '°',
  '|': 'ñ',
  '}': 'ç'
};

/**
 * Swedish character set
 * ESC (H or ESC (7
 * Reference: http://vt100.net/docs/vt220-rm/table2-14.html
 */
CHARSETS['H'] =
CHARSETS['7'] = {
  '@': 'É',
  '[': 'Ä',
  '\\': 'Ö',
  ']': 'Å',
  '^': 'Ü',
  '`': 'é',
  '{': 'ä',
  '|': 'ö',
  '}': 'å',
  '~': 'ü'
};

/**
 * Swiss character set
 * ESC (=
 * Reference: http://vt100.net/docs/vt220-rm/table2-15.html
 */
CHARSETS['='] = {
  '#': 'ù',
  '@': 'à',
  '[': 'é',
  '\\': 'ç',
  ']': 'ê',
  '^': 'î',
  // eslint-disable-next-line @typescript-eslint/naming-convention
  '_': 'è',
  '`': 'ô',
  '{': 'ä',
  '|': 'ö',
  '}': 'ü',
  '~': 'û'
};