Rustam's patch
[yaz-moved-to-github.git] / z39.50 / charneg-3.asn
1 NegotiationRecordDefinition-charSetandLanguageNegotiation-3\r
2 {Z39-50-negotiationRecordDefinition CharSetandLanguageNegotiation-3 (3)}\r
3 DEFINITIONS ::= BEGIN\r
4 IMPORTS LanguageCode FROM RecordSyntax-explain;\r
5 \r
6 CharSetandLanguageNegotiation ::= CHOICE{\r
7    proposal [1]   IMPLICIT OriginProposal,\r
8    response [2]   IMPLICIT TargetResponse}\r
9 --\r
10 -- For character sets:\r
11 --  Origin proposes one, two, or all three of the following, in order of\r
12 --  preference:\r
13 --       (a) 2022 character sets.\r
14 --       (b) 10646 character set.\r
15 --       (c) Private character set.\r
16 --\r
17 --    The target responds with one of (a), (b), or (c), indicating the\r
18 --    character set(s) to be supported for all name and message strings.\r
19 --\r
20 --    If the origin includes (a),\r
21 --     the origin proposes:\r
22 --        (1)  A proposed environment: 7-bit, 8-bit, or no-preference.\r
23 --        (2)  A set of iso 2022 registration numbers.\r
24 --        (3)  One or more proposed initial sets of registration numbers,\r
25 --             for c0, c1, g0, g1, g2 and g3. These must come from (2).\r
26 --        (4)  The proposed encoding level.\r
27 --      And if the target selects (a), it responds with:\r
28 --        (1)  A selected environment: 7-bit or 8-bit.\r
29 --        (2)  A subset of the set of iso 2022 registration numbers proposed\r
30 --             by the origin.\r
31 --        (3)  The initial set of registrations, which must come from (2)\r
32 --             but need not be from the set of initial registrations proposed\r
33 --             by the origin.\r
34 --        (4)  The encoding level; less than or equal to that proposed.\r
35 --\r
36 --    If the origin includes (b),\r
37 --     The origin proposes:\r
38 --        (1)  (optionally) A list of collections (i.e. subsets of characters from the\r
39 --             complete 10646 definition).\r
40 --        (2)  An implementation level.\r
41 --        (3) Syntax/form: e.g. ucs-2, ucs-4, utf-8, utf-16.\r
42 --    And if the target selects (b), it responds by choosing a subset of the\r
43 --    collections proposed by the origin in (1) and an implementation level less\r
44 --    than or equal to that proposed by the origin in (2).\r
45 --\r
46 --    If the origin includes (c), the origin proposes one of the following:\r
47 --        (1)  A list of private character sets, by one or more object\r
48 --             identifiers.\r
49 --        (2)  A list of private character sets, by an EXTERNAL.\r
50 --        (3)  An indication to use a private, previously agreed upon\r
51 --             character set.\r
52 --    And if the target selects (c):\r
53 --    -  If the origin proposed (1), the target should respond with (1), and\r
54 --       the list of object identifiers should be a subset of the list that\r
55 --       the origin included.\r
56 --    -  If the origin proposed (2), the target should respond with (2), using\r
57 --       the same EXTERNAL definition (but not necessarily the same content)\r
58 --       used by the origin.\r
59 --    -  If the origin proposed (3), the target should respond with (3).\r
60 --\r
61 --    For Languages:\r
62 --     The origin optionally proposes one or more language codes. The target\r
63 --     response may include a single language code, which indicates the\r
64 --     language to be used for all message strings. The target may include or\r
65 --     omit this, whether or not the origin included a proposed set, and the\r
66 --     language code indicated need not be from among those proposed.\r
67 --\r
68 --\r
69 \r
70 OriginProposal ::= SEQUENCE {\r
71   proposedCharSets           [1] IMPLICIT SEQUENCE OF CHOICE{\r
72                -- Each should occur at most once, and in order of preference\r
73                -- (the "order of preference" is the reason why this is\r
74                -- "SEQUENCE OF CHOICE" rather than just "SEQUENCE")\r
75                                 iso2022        [1] Iso2022,\r
76                                 iso10646       [2] IMPLICIT Iso10646,\r
77                                 private        [3] PrivateCharacterSet} OPTIONAL,\r
78                                    -- proposedCharSets must be omitted\r
79                                    -- if origin proposes version 2\r
80   proposedlanguages          [2] IMPLICIT SEQUENCE OF LanguageCode OPTIONAL,\r
81   recordsInSelectedCharSets  [3] IMPLICIT BOOLEAN OPTIONAL\r
82                        -- default 'false'. See rule 6 above.\r
83                        }\r
84 \r
85 TargetResponse ::= SEQUENCE{\r
86   selectedCharSets           [1] CHOICE{\r
87                                    iso2022        [1] Iso2022,\r
88                                    iso10646       [2] IMPLICIT Iso10646,\r
89                                    private        [3] PrivateCharacterSet,\r
90                                    none           [4] IMPLICIT NULL\r
91                                             -- If selected, no negotiation\r
92                                             -- is assumed to be in force\r
93                                             -- for character sets.\r
94                                                      } OPTIONAL,\r
95                                    -- Omitted if and only if proposedCharSets\r
96                                    -- was Omitted in the request.\r
97   selectedLanguage           [2] IMPLICIT LanguageCode OPTIONAL,\r
98   recordsInSelectedCharSets  [3] IMPLICIT BOOLEAN OPTIONAL\r
99                   -- Omitted if and only if 'recordsInSelectedCharSets' was omitted\r
100                   -- in the request.  See rule 6 above.\r
101                        }\r
102 \r
103 \r
104 PrivateCharacterSet ::= CHOICE{\r
105    viaOid                 [1] IMPLICIT SEQUENCE OF OBJECT IDENTIFIER,\r
106    externallySpecified    [2] IMPLICIT EXTERNAL,\r
107    previouslyAgreedUpon   [3] IMPLICIT NULL}\r
108 \r
109 -- IMPORTED\r
110 -- LanguageCode ::= GeneralString -- from ANSI Z39.53-1994\r
111 \r
112 -- Definition of ISO2022\r
113 -- For ISO 2022, the following is negotiated:\r
114 --   1)   The environment: 7-bit or 8-bit;\r
115 --   2)   a set of registration numbers (from the ISO Register of coded\r
116 --        character sets) for graphical and  control character sets;\r
117 --   3)   g0, g1, g2, g3, c0, c1, the registration numbers of the graphical and\r
118 --        control character sets that are  initially designated to g0, g1, etc.\r
119 --       The origin submits one or more sequences of values for\r
120 --        g0, g1, g2, g3, c0, c1 (for each sequence: at least one of\r
121 --        g0 and g1 must be included; g2 and g3 are optional and\r
122 --         may be included only if g1 is included;\r
123 --        c0 should be included; and c1 is optional); the target\r
124 --        selects one of the proposed sequences.\r
125 --   4)   gleft: which of g0, g1, g2 or g3, initially has GL shift status in\r
126 --        an 8-bit environment or has shift status in a 7-bit environment; and\r
127 --   5)   gright: which of g1, g2 or g3 initially has GR shift status in an\r
128 --        8-bit environment.\r
129 \r
130 Iso2022 ::= CHOICE{\r
131  originProposal   [1] IMPLICIT SEQUENCE{\r
132             proposedEnvironment    [0] Environment OPTIONAL,\r
133                                          -- omitted means no preference\r
134             proposedSets           [1] IMPLICIT SEQUENCE OF INTEGER,\r
135             proposedInitialSets    [2] IMPLICIT SEQUENCE OF\r
136                                              InitialSet,\r
137             proposedLeftAndRight   [3] IMPLICIT LeftAndRight},\r
138  targetResponse   [2] IMPLICIT SEQUENCE{\r
139             selectedEnvironment    [0] Environment,\r
140             selectedSets           [1] IMPLICIT SEQUENCE OF INTEGER,\r
141             selectedinitialSet     [2] IMPLICIT InitialSet,\r
142             selectedLeftAndRight   [3] IMPLICIT LeftAndRight}}\r
143 \r
144 Environment ::= CHOICE{\r
145    sevenBit    [1] IMPLICIT NULL,\r
146    eightBit    [2] IMPLICIT NULL}\r
147 \r
148 InitialSet::= SEQUENCE{\r
149       g0    [0] IMPLICIT INTEGER OPTIONAL,\r
150       g1    [1] IMPLICIT INTEGER OPTIONAL,\r
151                            -- one of g0 and g1 must be included\r
152       g2    [2] IMPLICIT INTEGER OPTIONAL,\r
153       g3    [3] IMPLICIT INTEGER OPTIONAL,\r
154                            --g2 and/or g3 may be included\r
155                            -- only if g1 was included\r
156       c0    [4] IMPLICIT INTEGER,\r
157       c1    [5] IMPLICIT INTEGER OPTIONAL}\r
158 \r
159 LeftAndRight ::= SEQUENCE{\r
160             gLeft         [3] IMPLICIT INTEGER{\r
161                                    g0 (0),\r
162                                    g1 (1),\r
163                                    g2 (2),\r
164                                    g3 (3)},\r
165             gRight        [4] IMPLICIT INTEGER{\r
166                                    g1 (1),\r
167                                    g2 (2),\r
168                                    g3 (3)} OPTIONAL}\r
169 \r
170 -- Definition of Iso10646\r
171 --\r
172 -- The 10646 object identifier looks like:\r
173 --        1.0.10646.1.implementationLevel.repertoireSubset.arc1.arc2. ....\r
174 --\r
175 -- (The second '1' is for "part 1" of 10646.)\r
176 --\r
177 -- ImplementationLevel is 1-3\r
178 --\r
179 -- repertoireSubset is 0 or 1, for 'all' or 'collections'.\r
180 -- The arcs are present only if repertoireSubset is 'collections',\r
181 -- in which case  arc1, arc2, etc., are the\r
182 -- identifiers of collections of character repertoires.\r
183 --\r
184 -- There is a second 10646 oid, for specifying syntax/form:\r
185 --        1.0.10646.1.0.form\r
186 --\r
187 -- (The second '0' represents "transfer syntax".)\r
188 --\r
189 --  where values of form include:\r
190 --  2: ucs-2\r
191 --  4: ucs-4\r
192 --  5: utf-16\r
193 --  8: utf-8\r
194 \r
195 Iso10646 ::= SEQUENCE{\r
196    collections    [1] IMPLICIT OBJECT IDENTIFIER OPTIONAL,\r
197                        --oid of form 1.0.10646.1.implementationLevel\r
198                        -- .repertoireSubset.arc1.arc2. ....\r
199                        -- Target to choose a subset of the collections\r
200                        -- proposed by the origin, and an implementation level\r
201                        -- less than or equal to that proposed.\r
202                        --\r
203                        -- when 'collections' is omitted,\r
204                        -- 'implementationLevel' defaults to 3.\r
205                        --\r
206    encodingLevel  [2] IMPLICIT OBJECT IDENTIFIER\r
207                        -- oid of form 1.0.10646.1.0.form\r
208                     -- where value of 'form' is 2, 4, 5, or 8\r
209                       -- for ucs-2, ucs-4, utf-16, utf-8\r
210                                    }\r
211 END