4 * Copyright (c) 2012 David Herrmann <dh.herrmann@googlemail.com>
6 * Permission is hereby granted, free of charge, to any person obtaining
7 * a copy of this software and associated documentation files
8 * (the "Software"), to deal in the Software without restriction, including
9 * without limitation the rights to use, copy, modify, merge, publish,
10 * distribute, sublicense, and/or sell copies of the Software, and to
11 * permit persons to whom the Software is furnished to do so, subject to
12 * the following conditions:
14 * The above copyright notice and this permission notice shall be included
15 * in all copies or substantial portions of the Software.
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
20 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
21 * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
22 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
23 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28 * These are predefined charactersets that can be loaded into GL and GR. By
29 * default we use unicode_lower and unicode_upper, that is, both sets have the
30 * exact unicode mapping. unicode_lower is effectively ASCII and unicode_upper
31 * as defined by the unicode standard.
32 * Several other character sets are defined here. However, all of them are
33 * limited to the 96 character space of GL or GR. Everything beyond GR (which
34 * was not supported by the classic VTs by DEC but is available in VT emulators
35 * that support unicode/UTF8) is always mapped to unicode and cannot be changed
36 * by these character sets. Even mapping GL and GR is only available for
37 * backwards compatibility as new applications can use the Unicode functionality
40 * Moreover, mapping GR is almost unnecessary to support. In fact, Unicode UTF-8
41 * support in VTE works by reading every incoming data as UTF-8 stream. This
42 * maps GL/ASCII to ASCII, as UTF-8 is backwards compatible to ASCII, however,
43 * everything that has the 8th bit set is a >=2-byte haracter in UTF-8. That is,
44 * this is in no way backwards compatible to >=VT220 8bit support. Therefore, if
45 * someone maps a character set into GR and wants to use them with this VTE,
46 * then they must already send UTF-8 characters to use GR (all GR characters are
47 * 8-bits). Hence, they can easily also send the correct UTF-8 character for the
49 * The only advantage is that most characters in many sets are 3-byte UTF-8
50 * characters and by mapping the set into GR/GL you can use 2 or 1 byte UTF-8
51 * characters which saves bandwidth.
52 * Another reason is, if you have older applications that use the VT220 8-bit
53 * support and you put a ASCII/8bit-extension to UTF-8 converter in between, you
54 * need these mappings to have the application behave correctly if it uses GL/GR
55 * mappings extensively.
57 * Anyway, we support GL/GR mappings so here are the most commonly used maps as
58 * defined by Unicode-standard, DEC-private maps and other famous charmaps.
60 * Characters 1-32 are always the control characters (part of CL) and cannot be
61 * mapped. Characters 34-127 (94 characters) are part of GL and can be mapped.
62 * Characters 33 and 128 are not part of GL and always mapped by VTE but are
63 * included here in the maps for alignment reasons but always set to 0.
73 * Lower Unicode character set. This maps the characters to the basic ASCII
74 * characters 33-126. These are all graphics characters defined in ASCII. The
75 * first an last entry are never used so we can safely set them to anything.
78 tsm_vte_charset tsm_vte_unicode_lower = {
178 * Upper Unicode Table
179 * This maps all characters to the upper unicode characters 161-254. These are
180 * not compatible to any older 8 bit character sets. See the Unicode standard
181 * for the definitions of each symbol. Again, the first an last entry are never
182 * used so set them to 0.
185 tsm_vte_charset tsm_vte_unicode_upper = {
285 * The DEC supplemental graphics set. For its definition see here:
286 * http://vt100.net/docs/vt220-rm/table2-3b.html
287 * Its basically a mixture of common European symbols that are not part of
288 * ASCII. Most often, this is mapped into GR to extend the basci ASCII part.
290 * This is very similar to unicode_upper, however, few symbols differ so do not
294 tsm_vte_charset tsm_vte_dec_supplemental_graphics = {
394 * DEC special graphics character set. See here for its definition:
395 * http://vt100.net/docs/vt220-rm/table2-4.html
396 * This contains several characters to create ASCII drawings and similar. Its
397 * commonly mapped into GR to extend the basic ASCII characters.
399 * Lower 62 characters map to ASCII 33-64, everything beyond is special and
400 * commonly used for ASCII drawings. It depends on the Unicode Standard 3.2 for
401 * the extended horizontal scan-line characters 3, 5, 7, and 9.
404 tsm_vte_charset tsm_vte_dec_special_graphics = {