+NegotiationRecordDefinition-charSetandLanguageNegotiation-3\r
+{Z39-50-negotiationRecordDefinition CharSetandLanguageNegotiation-3 (3)}\r
+DEFINITIONS ::= BEGIN\r
+IMPORTS LanguageCode FROM RecordSyntax-explain;\r
+\r
+CharSetandLanguageNegotiation ::= CHOICE{\r
+ proposal [1] IMPLICIT OriginProposal,\r
+ response [2] IMPLICIT TargetResponse}\r
+--\r
+-- For character sets:\r
+-- Origin proposes one, two, or all three of the following, in order of\r
+-- preference:\r
+-- (a) 2022 character sets.\r
+-- (b) 10646 character set.\r
+-- (c) Private character set.\r
+--\r
+-- The target responds with one of (a), (b), or (c), indicating the\r
+-- character set(s) to be supported for all name and message strings.\r
+--\r
+-- If the origin includes (a),\r
+-- the origin proposes:\r
+-- (1) A proposed environment: 7-bit, 8-bit, or no-preference.\r
+-- (2) A set of iso 2022 registration numbers.\r
+-- (3) One or more proposed initial sets of registration numbers,\r
+-- for c0, c1, g0, g1, g2 and g3. These must come from (2).\r
+-- (4) The proposed encoding level.\r
+-- And if the target selects (a), it responds with:\r
+-- (1) A selected environment: 7-bit or 8-bit.\r
+-- (2) A subset of the set of iso 2022 registration numbers proposed\r
+-- by the origin.\r
+-- (3) The initial set of registrations, which must come from (2)\r
+-- but need not be from the set of initial registrations proposed\r
+-- by the origin.\r
+-- (4) The encoding level; less than or equal to that proposed.\r
+--\r
+-- If the origin includes (b),\r
+-- The origin proposes:\r
+-- (1) (optionally) A list of collections (i.e. subsets of characters from the\r
+-- complete 10646 definition).\r
+-- (2) An implementation level.\r
+-- (3) Syntax/form: e.g. ucs-2, ucs-4, utf-8, utf-16.\r
+-- And if the target selects (b), it responds by choosing a subset of the\r
+-- collections proposed by the origin in (1) and an implementation level less\r
+-- than or equal to that proposed by the origin in (2).\r
+--\r
+-- If the origin includes (c), the origin proposes one of the following:\r
+-- (1) A list of private character sets, by one or more object\r
+-- identifiers.\r
+-- (2) A list of private character sets, by an EXTERNAL.\r
+-- (3) An indication to use a private, previously agreed upon\r
+-- character set.\r
+-- And if the target selects (c):\r
+-- - If the origin proposed (1), the target should respond with (1), and\r
+-- the list of object identifiers should be a subset of the list that\r
+-- the origin included.\r
+-- - If the origin proposed (2), the target should respond with (2), using\r
+-- the same EXTERNAL definition (but not necessarily the same content)\r
+-- used by the origin.\r
+-- - If the origin proposed (3), the target should respond with (3).\r
+--\r
+-- For Languages:\r
+-- The origin optionally proposes one or more language codes. The target\r
+-- response may include a single language code, which indicates the\r
+-- language to be used for all message strings. The target may include or\r
+-- omit this, whether or not the origin included a proposed set, and the\r
+-- language code indicated need not be from among those proposed.\r
+--\r
+--\r
+\r
+OriginProposal ::= SEQUENCE {\r
+ proposedCharSets [1] IMPLICIT SEQUENCE OF CHOICE{\r
+ -- Each should occur at most once, and in order of preference\r
+ -- (the "order of preference" is the reason why this is\r
+ -- "SEQUENCE OF CHOICE" rather than just "SEQUENCE")\r
+ iso2022 [1] Iso2022,\r
+ iso10646 [2] IMPLICIT Iso10646,\r
+ private [3] PrivateCharacterSet} OPTIONAL,\r
+ -- proposedCharSets must be omitted\r
+ -- if origin proposes version 2\r
+ proposedlanguages [2] IMPLICIT SEQUENCE OF LanguageCode OPTIONAL,\r
+ recordsInSelectedCharSets [3] IMPLICIT BOOLEAN OPTIONAL\r
+ -- default 'false'. See rule 6 above.\r
+ }\r
+\r
+TargetResponse ::= SEQUENCE{\r
+ selectedCharSets [1] CHOICE{\r
+ iso2022 [1] Iso2022,\r
+ iso10646 [2] IMPLICIT Iso10646,\r
+ private [3] PrivateCharacterSet,\r
+ none [4] IMPLICIT NULL\r
+ -- If selected, no negotiation\r
+ -- is assumed to be in force\r
+ -- for character sets.\r
+ } OPTIONAL,\r
+ -- Omitted if and only if proposedCharSets\r
+ -- was Omitted in the request.\r
+ selectedLanguage [2] IMPLICIT LanguageCode OPTIONAL,\r
+ recordsInSelectedCharSets [3] IMPLICIT BOOLEAN OPTIONAL\r
+ -- Omitted if and only if 'recordsInSelectedCharSets' was omitted\r
+ -- in the request. See rule 6 above.\r
+ }\r
+\r
+\r
+PrivateCharacterSet ::= CHOICE{\r
+ viaOid [1] IMPLICIT SEQUENCE OF OBJECT IDENTIFIER,\r
+ externallySpecified [2] IMPLICIT EXTERNAL,\r
+ previouslyAgreedUpon [3] IMPLICIT NULL}\r
+\r
+-- IMPORTED\r
+-- LanguageCode ::= GeneralString -- from ANSI Z39.53-1994\r
+\r
+-- Definition of ISO2022\r
+-- For ISO 2022, the following is negotiated:\r
+-- 1) The environment: 7-bit or 8-bit;\r
+-- 2) a set of registration numbers (from the ISO Register of coded\r
+-- character sets) for graphical and control character sets;\r
+-- 3) g0, g1, g2, g3, c0, c1, the registration numbers of the graphical and\r
+-- control character sets that are initially designated to g0, g1, etc.\r
+-- The origin submits one or more sequences of values for\r
+-- g0, g1, g2, g3, c0, c1 (for each sequence: at least one of\r
+-- g0 and g1 must be included; g2 and g3 are optional and\r
+-- may be included only if g1 is included;\r
+-- c0 should be included; and c1 is optional); the target\r
+-- selects one of the proposed sequences.\r
+-- 4) gleft: which of g0, g1, g2 or g3, initially has GL shift status in\r
+-- an 8-bit environment or has shift status in a 7-bit environment; and\r
+-- 5) gright: which of g1, g2 or g3 initially has GR shift status in an\r
+-- 8-bit environment.\r
+\r
+Iso2022 ::= CHOICE{\r
+ originProposal [1] IMPLICIT SEQUENCE{\r
+ proposedEnvironment [0] Environment OPTIONAL,\r
+ -- omitted means no preference\r
+ proposedSets [1] IMPLICIT SEQUENCE OF INTEGER,\r
+ proposedInitialSets [2] IMPLICIT SEQUENCE OF\r
+ InitialSet,\r
+ proposedLeftAndRight [3] IMPLICIT LeftAndRight},\r
+ targetResponse [2] IMPLICIT SEQUENCE{\r
+ selectedEnvironment [0] Environment,\r
+ selectedSets [1] IMPLICIT SEQUENCE OF INTEGER,\r
+ selectedinitialSet [2] IMPLICIT InitialSet,\r
+ selectedLeftAndRight [3] IMPLICIT LeftAndRight}}\r
+\r
+Environment ::= CHOICE{\r
+ sevenBit [1] IMPLICIT NULL,\r
+ eightBit [2] IMPLICIT NULL}\r
+\r
+InitialSet::= SEQUENCE{\r
+ g0 [0] IMPLICIT INTEGER OPTIONAL,\r
+ g1 [1] IMPLICIT INTEGER OPTIONAL,\r
+ -- one of g0 and g1 must be included\r
+ g2 [2] IMPLICIT INTEGER OPTIONAL,\r
+ g3 [3] IMPLICIT INTEGER OPTIONAL,\r
+ --g2 and/or g3 may be included\r
+ -- only if g1 was included\r
+ c0 [4] IMPLICIT INTEGER,\r
+ c1 [5] IMPLICIT INTEGER OPTIONAL}\r
+\r
+LeftAndRight ::= SEQUENCE{\r
+ gLeft [3] IMPLICIT INTEGER{\r
+ g0 (0),\r
+ g1 (1),\r
+ g2 (2),\r
+ g3 (3)},\r
+ gRight [4] IMPLICIT INTEGER{\r
+ g1 (1),\r
+ g2 (2),\r
+ g3 (3)} OPTIONAL}\r
+\r
+-- Definition of Iso10646\r
+--\r
+-- The 10646 object identifier looks like:\r
+-- 1.0.10646.1.implementationLevel.repertoireSubset.arc1.arc2. ....\r
+--\r
+-- (The second '1' is for "part 1" of 10646.)\r
+--\r
+-- ImplementationLevel is 1-3\r
+--\r
+-- repertoireSubset is 0 or 1, for 'all' or 'collections'.\r
+-- The arcs are present only if repertoireSubset is 'collections',\r
+-- in which case arc1, arc2, etc., are the\r
+-- identifiers of collections of character repertoires.\r
+--\r
+-- There is a second 10646 oid, for specifying syntax/form:\r
+-- 1.0.10646.1.0.form\r
+--\r
+-- (The second '0' represents "transfer syntax".)\r
+--\r
+-- where values of form include:\r
+-- 2: ucs-2\r
+-- 4: ucs-4\r
+-- 5: utf-16\r
+-- 8: utf-8\r
+\r
+Iso10646 ::= SEQUENCE{\r
+ collections [1] IMPLICIT OBJECT IDENTIFIER OPTIONAL,\r
+ --oid of form 1.0.10646.1.implementationLevel\r
+ -- .repertoireSubset.arc1.arc2. ....\r
+ -- Target to choose a subset of the collections\r
+ -- proposed by the origin, and an implementation level\r
+ -- less than or equal to that proposed.\r
+ --\r
+ -- when 'collections' is omitted,\r
+ -- 'implementationLevel' defaults to 3.\r
+ --\r
+ encodingLevel [2] IMPLICIT OBJECT IDENTIFIER\r
+ -- oid of form 1.0.10646.1.0.form\r
+ -- where value of 'form' is 2, 4, 5, or 8\r
+ -- for ucs-2, ucs-4, utf-16, utf-8\r
+ }\r
+END
\ No newline at end of file