blob: cc2acada710a37295a78c8b0f1ddc8be098668db [file] [log] [blame]
vlmfa67ddc2004-06-03 03:38:44 +00001/*-
vlm1afa3342006-10-16 12:18:10 +00002 * Copyright (c) 2003, 2006 Lev Walkin <vlm@lionet.info>. All rights reserved.
vlmfa67ddc2004-06-03 03:38:44 +00003 * Redistribution and modifications are permitted subject to BSD license.
4 */
vlm39ba4c42004-09-22 16:06:28 +00005#include <asn_internal.h>
vlmfa67ddc2004-06-03 03:38:44 +00006#include <TeletexString.h>
7
8/*
9 * TeletexString basic type description.
10 */
vlmef6355b2004-09-29 13:26:15 +000011static ber_tlv_tag_t asn_DEF_TeletexString_tags[] = {
vlm72425de2004-09-13 08:31:01 +000012 (ASN_TAG_CLASS_UNIVERSAL | (20 << 2)), /* [UNIVERSAL 20] IMPLICIT ...*/
13 (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), /* ... OCTET STRING */
vlmfa67ddc2004-06-03 03:38:44 +000014};
vlmef6355b2004-09-29 13:26:15 +000015asn_TYPE_descriptor_t asn_DEF_TeletexString = {
vlmfa67ddc2004-06-03 03:38:44 +000016 "TeletexString",
vlm9de248e2004-10-20 15:50:55 +000017 "TeletexString",
vlm39ba4c42004-09-22 16:06:28 +000018 OCTET_STRING_free,
19 OCTET_STRING_print, /* non-ascii string */
vlmfa67ddc2004-06-03 03:38:44 +000020 asn_generic_unknown_constraint,
21 OCTET_STRING_decode_ber, /* Implemented in terms of OCTET STRING */
vlm9de248e2004-10-20 15:50:55 +000022 OCTET_STRING_encode_der,
23 OCTET_STRING_decode_xer_hex,
24 OCTET_STRING_encode_xer,
vlm86380d32006-10-09 12:07:58 +000025 OCTET_STRING_decode_uper,
26 OCTET_STRING_encode_uper,
vlmfa67ddc2004-06-03 03:38:44 +000027 0, /* Use generic outmost tag fetcher */
vlmef6355b2004-09-29 13:26:15 +000028 asn_DEF_TeletexString_tags,
29 sizeof(asn_DEF_TeletexString_tags)
30 / sizeof(asn_DEF_TeletexString_tags[0]) - 1,
31 asn_DEF_TeletexString_tags,
32 sizeof(asn_DEF_TeletexString_tags)
33 / sizeof(asn_DEF_TeletexString_tags[0]),
vlm337167e2005-11-26 11:25:14 +000034 0, /* No PER visible constraints */
vlme413c122004-08-20 13:23:42 +000035 0, 0, /* No members */
vlmb42843a2004-06-05 08:17:50 +000036 0 /* No specifics */
vlmfa67ddc2004-06-03 03:38:44 +000037};
38
vlm1afa3342006-10-16 12:18:10 +000039/*
40 * Here is a formal attempt at creating a mapping from TeletexString
41 * (T61String) of the latest ASN.1 standard (X.680:2002) into the Unicode
42 * character set. -- Lev Walkin <vlm@lionet.info>
43 *
44 * The first thing to keep in mind is that TeletexString (T61String)
45 * is defined in ASN.1, and is not really a T.61 string.
46 * The T.61 standard is withdrawn by ITU-T and is no longer an authoritative
47 * reference. See http://www.itu.int/rec/T-REC-T.61
48 *
49 * The X.680 specifies TeletexString (T61String) as a combination of the
50 * character sets specified by the registration numbers listed in
51 * ISO International Register of Coded Character Sets to be used with
52 * Escape Sequences (ISO-2375):
53 * 6, 87, 102, 103, 106, 107, 126, 144, 150, 153, 156, 164, 165, 168,
54 * plus SPACE and DELETE characters.
55 * In addition to that, the X.680 Table 6 NOTE 2 allows using register entries
56 * 6 and 156 instead of 102 and 103.
57 *
58 * The ISO Register itself is available at http://www.itscj.ipsj.or.jp/ISO-IR/
59 *
60 * #6 is ASCII. http://www.itscj.ipsj.or.jp/ISO-IR/006.pdf
61 * Escapes into:
62 * G0: ESC 2/8 4/2 ("(B")
63 * G1: ESC 2/9 4/2 (")B")
64 * The range is [0x21 .. 0x7e]. Conversion into Unicode
65 * is simple, because it has one-to-one correspondence.
66 * #87 is a "Japanese Graphic Character Set for Information Interchange".
67 * Is a multiple-byte set of 6877 characters.
68 * The character set is JIS X 0208-1983 (originally JIS C 6226-1983).
69 * Escapes into:
70 * G0: ESC 2/4 4/2 ("$B")
71 * G1: ESC 2/4 2/9 4/2 ("$)B")
72 * G2: ESC 2/4 2/10 4/2 ("$*B")
73 * G3: ESC 2/4 2/11 4/2 ("$+B")
74 * #102 is "Teletex Primary Set of Graphic Characters" and is almost ASCII.
75 * Escapes into:
76 * G0: ESC 2/8 7/5 ("(u")
77 * G1: ESC 2/9 7/5 (")u")
78 * G2: ESC 2/10 7/5 ("*u")
79 * G3: ESC 2/11 7/5 ("+u")
80 * It is almost identical to ASCII, except for ASCII position for '$'
81 * (DOLLAR SIGN) is filled with 'ยค' (CURRENCY SIGN), which is U+00A4.
82 * Also, ASCII positions for '`', '\', '^', '{', '}', '~' are marked
83 * as "should not be used".
84 * #103 is a supplementary set of characters used in combination with #102.
85 * Escapes into:
86 * G0: ESC 2/8 7/6 ("(v")
87 * G1: ESC 2/9 7/6 (")v")
88 * G2: ESC 2/10 7/6 ("*v")
89 * G3: ESC 2/11 7/6 ("+v")
90 * Some characters in that character set are combining characters,
91 * which can only be restrictively used with certain basic Latin letters.
92 * It can be thought of as a subset of #156 with the exception of 4/12
93 * which is UNDERLINE in #103 and absent in #156.
94 * #106 is a primary set of control functions, used in combination with #107.
95 * Escapes into:
96 * C0: ESC 2/1 4/5 ("!E")
97 * This set is so short I can list it here:
98 * 0x08 BS BACKSPACE -- same as Unicode
99 * 0x0a LF LINE FEED -- same as Unicode
100 * 0x0c FF FORM FEED -- same as Unicode
101 * 0x0d CR CARRIAGE RETURN -- same as Unicode
102 * 0x0e LS1 LOCKING SHIFT ONE
103 * 0x0f LS0 LOCKING SHIFT ZERO
104 * 0x19 SS2 SINGLE SHIFT TWO
105 * 0x1a SUB SUBSTITUTE CHARACTER
106 * 0x1b ESC ESCAPE -- same as Unicode
107 * 0x1d SS3 SINGLE SHIFT THREE
108 * The LS1 and LS0 are two magical functions which, respectively, invoke
109 * the currently designated G1 or G0 set into positions 2/1 to 7/14
110 * The SS2 and SS3, respectively, invoke one character of the
111 * currently designated set G2 and G3.
112 * The SUB is wholly equivalent to U+001a (SUBSTITUTE)
113 * #107 is a supplementary set of control functions, used with #106.
114 * Escapes into:
115 * C1: ESC 2/2 4/8 ('"H')
116 * This set contains three special control codes:
117 * 0x8b PLD PARTIAL LINE DOWN -- similar to <SUB>
118 * 0x8c PLU PARTIAL LINE UP -- sumilar to <SUP>
119 * 0x9b CSI CONTROL SEQUENCE INTRODUCER
120 * This set is so out of world we can probably safely ignore it.
121 * #126 is a "Right-hand Part of the Latin/Greek Alphabet".
122 * Comprises of 90 characters, including accented letters.
123 * Escapes into:
124 * G1: ESC 2/13 4/6 ("-F")
125 * G2: ESC 2/14 4/6 (".F")
126 * G3: ESC 2/15 4/6 ("/F")
127 * Note: This Registration is a subset of ISO-IR 227.
128 * #144 is a "Cyrillic part of the Latin/Cyrillic Alphabet".
129 * Comprises of 95 characters.
130 * Escapes into:
131 * G1: ESC 2/13 4/12 ("-L")
132 * G2: ESC 2/14 4/12 (".L")
133 * G3: ESC 2/15 4/12 ("/L")
134 * #150 is a "Greek Primary Set of Graphic Characters".
135 * Comprises of 94 characters.
136 * Escapes into:
137 * G0: ESC 2/8 2/1 4/0 ("(!@")
138 * G1: ESC 2/9 2/1 4/0 (")!@")
139 * G2: ESC 2/10 2/1 4/0 ("*!@")
140 * G3: ESC 2/11 2/1 4/0 ("+!@")
141 * #153 is a "Basic Cyrillic Character Set for 8-bit codes".
142 * Comprises of 68 characters.
143 * Escapes into:
144 * G1: ESC 2/13 4/15 ("-O")
145 * G2: ESC 2/14 4/15 (".O")
146 * G3: ESC 2/15 4/15 ("/O")
147 * #156 is a "Supplementary Set of ISO/IEC 6937:1992" for use with #6
148 * Comprises of 87 characters.
149 * Escapes into:
150 * G1: ESC 2/13 5/2 ("-R")
151 * G2: ESC 2/14 5/2 (".R")
152 * G3: ESC 2/15 5/2 ("/R")
153 * #164 is a "Hebrew Supplementary Set of Graphic Characters"
154 * Comprises of 27 characters.
155 * Escapes into:
156 * G1: ESC 2/13 5/3 ("-S")
157 * G2: ESC 2/14 5/3 (".S")
158 * G3: ESC 2/15 5/3 ("/S")
159 * #165 is a set of "Codes of the Chinese graphic character set"
160 * Is a multiple-byte set of 8446 characters.
161 * Escapes into:
162 * G0: ESC 2/4 2/8 4/5 ("$(E")
163 * G1: ESC 2/4 2/9 4/5 ("$)E")
164 * G2: ESC 2/4 2/10 4/5 ("$*E")
165 * G3: ESC 2/4 2/11 4/5 ("$+E")
166 * #168 is a "Japanese Graphic Character Set for Information Interchange"
167 * A multiple-byte set of 6879 characters updated from #87.
168 * Escapes into:
169 * G0: ESC 2/6 4/0 ESC 2/4 4/2 ("&@" "$B")
170 * G1: ESC 2/6 4/0 ESC 2/4 2/9 4/2 ("&@" "$)B")
171 * G2: ESC 2/6 4/0 ESC 2/4 2/10 4/2 ("&@" "$*B")
172 * G3: ESC 2/6 4/0 ESC 2/4 2/11 4/2 ("&@" "$+B")
173 */
174