home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / protocol / isok6.txt < prev    next >
Text File  |  2020-01-01  |  108KB  |  2,183 lines

  1.  
  2.      A KERMIT PROTOCOL EXTENSION FOR INTERNATIONAL CHARACTER SETS
  3.  
  4.                   **********
  5.    NOTE: This is a work in progress, and will be updated from time to time.
  6.                   **********
  7.  
  8.                   Christine Gianone
  9.               cmg@watsun.cc.columbia.edu
  10.          Manager, Kermit Development and Distribution
  11.  
  12.                 Frank da Cruz
  13.               fdc@watsun.cc.columbia.edu
  14.               Manager, Network Planning
  15.  
  16.          Columbia University Center for Computing Activities
  17.                 612 West 115th Street
  18.                New York, NY 10025, USA
  19.  
  20.                    DRAFT NUMBER 6.3
  21.                    OCTOBER 24, 1991
  22.  
  23. ABSTRACT
  24.  
  25. An extension to the presentation layer of the Kermit file transfer protocol
  26. is proposed to allow transfer of non-English-language text files between
  27. unlike computers by substitution of standard character sets other than ASCII
  28. in Kermit's text-file transfer data packets.  Methods for selection,
  29. announcement, and use of these character sets are described.  The reader is
  30. assumed to be familiar with the Kermit file transfer protocol and with basic
  31. computing and terminology.  The relevant ANSI and ISO character-set related
  32. standards are summarized in Appendix B of this document.
  33.  
  34. This is a nearly final draft.  The protocol and many of the commands described
  35. in this document have been successfully implemented in major Kermit programs
  36. including MS-DOS Kermit 3.0, C-Kermit 5A for UNIX and VAX/VMS, and IBM
  37. Mainframe Kermit 4.2 for VM/CMS, MVS/TSO, MUSIC, and CICS.  Special thanks
  38. to John Chandler and Hirofumi Fujii for extensive contributions to this
  39. draft, and to John Klensin for his comments and support.
  40.  
  41. SUMMARY OF CHANGES SINCE DRAFT #5, April, 1990
  42.  
  43.  - Abandonment of the two-level concept.  Mixed languages will be
  44.    handled by using ISO 10646 as the transfer character set.  The details
  45.    remain to be specified.
  46.  - Abandonment of CSN 36 91 03, Czechoslovak Standard alphabet as a transfer
  47.    character set.  Czech is adequately covered by ISO 8859-2.
  48.  - Adoption of Japanese EUC as the transfer character set for Japanese
  49.    text files, rather than JIS X 0208.
  50.  - Explanation of Japanese EUC added to Appendix B.
  51.  - Reference to Kermit's new locking shift transport protocol.
  52.  - Removal of (unworkable) design for user-defined translations.
  53.  - Addition of mechanism for automatic translation-table selection.
  54.  - Addition of notion of "translation goal" and related commands.
  55.  - Deletion of irrelevant or redundant appendices.
  56.  - Addition of an annotated References section.
  57.  - Short sections added on terminology and notation.
  58.  - Note: Table I moved to Appendix B, so table numbers are out of order.
  59.  
  60. SUMMARY OF CHANGES SINCE DRAFT #4, August, 1989
  61.  
  62.  - Changes for Level 1 only, to reflect experience in writing the code
  63.    to implement it for MS-DOS Kermit 3.0, C-Kermit 5A, and Kermit 370 4.2.
  64.    Level 2 is on hold indefinitely pending ISO 10646 & Unicode developments.
  65.  - Abandonment of separate attributes for encoding and character set.
  66.  - Change all references to ASCII as I2 into I6 (ISO Registration Number).
  67.  - Change description of SET LANGUAGE to remove side effects.
  68.  - Differentiation of SET TRANSFER CHARACTER ASCII and TRANSPARENT.
  69.  - The section on terminal emulation has not been changed, even though
  70.    this subject needs detailed treatment in this document.
  71.  
  72. SUMMARY OF CHANGES SINCE DRAFT #3, July 20, 1989
  73.  
  74.  - Expanded & more precise definition of Kermit's character set designators
  75.  - Simplification of the syntax of the (former) SET TRANSFER-SYNTAX command
  76.  - Addition of SET LANGUAGE command
  77.  - Clarification of Kermit's behavior when it receives an unknown character set
  78.  - Addition of Appendix F to specify how each Kermit Level is invoked
  79.  - Correction of numerous typographical and other errors
  80.  
  81. ACKNOWLEDGEMENTS
  82.  
  83. Many thanks to these people for their helpful and constructive comments during
  84. the drafting process.  In most cases, their suggestions or the information
  85. they provided have been incorporated into this or previous drafts.
  86.  
  87.   John Chandler (Harvard/Smithsonian Center for Astrophysics, USA)
  88.   Alan Curtis (University of London, UK)
  89.   Joe Doupnik (Utah State University, USA)
  90.   Hirofumi Fujii (Japan National Laboratory of High Energy Physics, Tokyo)
  91.   John Klensin (Massachusetts Institute of Technology, USA)
  92.   Ken-ichiro Murakami (Nippon Telephone and Telegraph Research Labs, Tokyo)
  93.   Vladimir Novikov (VNIIPAS, Moscow, USSR)
  94.   Jacob Palme (Stockholm University, Sweden)
  95.   Andre Pirard (University of Liege, Belgium)
  96.   Paul Placeway (Ohio State University, USA)
  97.   Gisbert W. Selke (WIdO, Bonn, Germany)
  98.   Fridrik Skulason (University of Iceland, Reykjavik, Iceland)
  99.   Johan van Wingen (Leiden, Netherlands)
  100.   Konstantin Vinogradov (ICSTI, Moscow, USSR)
  101.   Amanda Walker (InterCon Systems Corp, USA)
  102.  
  103. Thanks also to the following people for organizing meetings or conferences
  104. in their countries at which the issues of this proposal were discussed:
  105.  
  106.   Kohichi Nishimoto (Nihon DEC, Tokyo, Japan)
  107.   Juri Gornostaev and A. Butrimenko (ICSTI, Moscow, USSR)
  108.  
  109. and thanks also to those who attended these gatherings!
  110.  
  111. Thanks to the Kermit developers who have implemented this extension in their
  112. Kermit programs:
  113.  
  114.   John Chandler  (Kermit-370)
  115.   Frank da Cruz  (C-Kermit)
  116.   Joe Doupnik    (MS-DOS Kermit)
  117.   Hirofumi Fujii (C-Kermit, MS-DOS Kermit, and NEC PC9801 Kermit)
  118.  
  119. Finally, thanks to other experts who provided valuable information:
  120.  
  121.   Jerry Andersen, IBM
  122.   Lloyd Anderson, Ecological Linguistics
  123.   Joe Becker, Xerox Corporation and UNICODE Consortium
  124.   Edwin Hart, Johns Hopkins University Applied Physics Laboratory
  125.  
  126.  
  127. NOTATION
  128.  
  129. This document is written in plain 7-bit US ASCII, and to be understood
  130. correctly it should be displayed in plain 7-bit US ASCII.  The notation:
  131.  
  132.   <xxx>
  133.  
  134. is used to express a non-ASCII or non-graphic character, where "xxx" is
  135. replaced by the name of the character, for example:
  136.  
  137.   <ESC>       (All capital letters: the name of a control character)
  138.  
  139. or:
  140.  
  141.   <A-grave>   (Lower or mixed case: a letter with a diacritical mark)
  142.  
  143. In other places (which should be clear from the context), the same notation is
  144. used to denote a parameter to a Kermit command, for example:
  145.  
  146.   <filename>
  147.  
  148. to stand for the name of any file.
  149.  
  150.  
  151. TERMINOLOGY
  152.  
  153. A "character" is the minimum unit of a writing system: a letter, a digit, a
  154. punctuation mark, an ideogram, without regard to the style of rendering except
  155. for capitalization in scripts where that is possible, and without regard to
  156. computer encoding.
  157.  
  158. A "character set" is a particular, specified group of characters, for example
  159. (and most typically) all the letters, digits, and punctuation marks needed for
  160. a particular writing system.
  161.  
  162. A "coded character set" is the internal computer representation of a character
  163. set, in which each character is assigned a unique code, often with the
  164. addition of special control codes.  In this document, "character set" and
  165. "coded character set" are used synonymously unless otherwise noted.
  166.  
  167. "Code page" is the term used by IBM and Microsoft to mean "coded character
  168. set".
  169.  
  170. A "code point" is the association between a character and its encoding in a
  171. particular character set.
  172.  
  173. An "octet" is a computer storage unit of 8 bits.
  174.  
  175. A "byte" is an octet, unless otherwise noted.
  176.  
  177. The word "translation" is used loosely in this document to denote conversion
  178. between character set encodings, not translation between languages or any
  179. other higher-level notion.  When characters are intentionally replaced by
  180. different characters, the word "transliteration" is used.
  181.  
  182.  
  183. STATEMENT OF THE PROBLEM
  184.  
  185. The Kermit file transfer protocol has always been able to transfer text files
  186. between unlike computers (e.g. a UNIX system with ASCII stream text files and
  187. an IBM mainframe with EBCDIC record-oriented text files).  To do the text
  188. file code conversion, Kermit transfers text in ASCII.  However, ASCII
  189. includes only enough letters and symbols for English.
  190.  
  191. There are now computers capable of representing the characters of other
  192. languages: Roman letters with diacritical marks, Cyrillic letters, Hebrew,
  193. Arabic, and Greek characters; Chinese, Japanese, and Korean ideograms.
  194. However, different computer manufacturers use different codes for these
  195. characters.  For example, the IBM PS/2 and the Apple Macintosh both have
  196. character sets that are "8-bit ASCII".  When the character value is 32-127,
  197. the character is (normally) a standard ASCII graphic (printable) character.
  198. When the value is 128 or higher, it is a "special" character.  Unfortunately,
  199. the PC and the Macintosh assign different special characters to these values.
  200. Here are just a few examples:
  201.  
  202.    Value     PS/2 Character      Macintosh Character
  203.     138       Small e grave       Small a diaeresis
  204.     143       Capital A ring      Small e grave
  205.     144       Capital E acute     Small e circumflex
  206.     136       Small e circumflex  Small a grave
  207.  
  208. When a file contains "8-bit ASCII", basic Kermit transfers it without any
  209. character translation.  Therefore, a text file written in French, German,
  210. Italian, or Norwegian transferred between a PS/2 and a Macintosh will contain
  211. the wrong characters when it arrives at its destination: the PS/2's e-grave
  212. becomes a-diaeresis on the Macintosh, etc.
  213.  
  214. There are many computer vendors in the world and nobody controls what codes
  215. they use to represent characters.  Without a standard protocol for
  216. transferring non-ASCII text, each computer would have to know the codes of
  217. all the other computers in order for correct transfer of non-English text
  218. files to occur between all combinations of unlike systems.
  219.  
  220. To complicate matters, many computers now support more than one character
  221. set.  IBM mainframes have not only "standard" US EBCDIC, but also several
  222. EBCDIC-based Country Extended Code Pages (CECPs) for the support of West
  223. European languages, Hebrew, Kanji, etc.  The IBM PC and PS/2 have a variety
  224. of ASCII-based 8-bit code pages for the same purpose.  These character sets
  225. are a welcome addition because they allow users of these computers to create,
  226. display, and print documents in languages other than English.  Unfortunately,
  227. the computer's file system keeps no record of which character set is used in
  228. each file.
  229.  
  230. IBM is not the only source of private character sets.  The Apple Macintosh has
  231. many character sets and fonts.  DEC supports its own multinational character
  232. set as well as private encodings for Greek, Hebrew, etc.  The NeXT workstation
  233. has its own unique character set.  Similarly for Data General, Atari,
  234. Commodore, and many other computer manufacturers.  In the USSR, up to five
  235. different Cyrillic character sets are in use.  In Japan, there are many
  236. different encodings for Roman, Katakana, and Kanji characters.  China and
  237. Taiwan use different encodings for Chinese characters.  Computers in Viet Nam
  238. use a variety of encodings.
  239.  
  240.  
  241. NORMAL KERMIT FILE TRANSFER SYNTAX
  242.  
  243. The Kermit file transfer protocol makes a distinction between text and binary
  244. files.  Binary files are transmitted with no translation or conversion.  For
  245. text files, the Kermit protocol defines a standard intermediate
  246. representation ("transfer syntax") for text files, namely ASCII characters
  247. with carriage return and linefeed (CRLF) after each line, so text can be
  248. stored in useful fashion on any computer to which it is transferred.  Each
  249. Kermit program knows how to translate from the local text-file storage
  250. conventions to ASCII/CRLF syntax, and vice versa.  This is the basic,
  251. required, and default mode of operation for any Kermit program.
  252.  
  253.  
  254. INTERNATIONAL KERMIT TRANSFER SYNTAX
  255.  
  256. This proposal adds a new mechanism that permits the use of character sets
  257. other than ASCII in file transfer.  These additional character sets are taken
  258. from recognized national or international standards, such as the ISO 8859
  259. Latin Alphabets.
  260.  
  261. Using a standard character set (other than ASCII), it is possible to transfer
  262. a text file written in a language other than English between unlike
  263. computers, and it is also possible to transfer a text file containing more
  264. than one language.  For example Latin Alphabet 1 can represent a file
  265. containing a mixture of Italian, Norwegian, French, German, English, and
  266. Icelandic.
  267.  
  268. The character set used in a text file stored in a particular computer is
  269. called the "file character set" (FCS).  When the characters in a text file
  270. can be represented by a single standard character set, that character set can
  271. be used in place of ASCII in Kermit's transfer syntax.  This is called the
  272. "transfer character set" (TCS).  Whatever the transfer character set, there
  273. must be a mapping between the local file character set and the transfer
  274. character set.  That is, there must be a pair of translation functions in the
  275. program: one from the local file character set to the transfer character set,
  276. and one from the transfer set to the local set:
  277.  
  278.          COMPUTER A                                COMPUTER B
  279.     +------------------+                      +------------------+
  280.     | +-------------+  |                      |  +-------------+ |
  281.     | | Translation |  |      Transfer        |  | Translation | |
  282.     | | Function:   |--------------------------->| Function:   | |
  283.     | | FCS to TCS  |  |    Character Set     |  | TCS to FCS  | |
  284.     | +-------------+  |                      |  +-------------+ |
  285.     |       ^          |                      |        |         |
  286.     |       |          |                      |        v         |
  287.     |  Kermit Program  |                      |  Kermit Program  |
  288.     |      SEND        |                      |     RECEIVE      |
  289.     +------------------+                      +------------------+
  290.         ^                                          |
  291.         |                                          v
  292.     +------------------+                      +------------------+
  293.     |  Local File      |                      |  Local File      |
  294.     |  Character Set A |                      |  Character Set B |
  295.     +------------------+                      +------------------+
  296.  
  297. The use of a common, standard transfer character sets means that each Kermit
  298. program only has to know about its own local character sets and a small
  299. number of standard ones.
  300.  
  301. International transfer syntax is an optional feature for Kermit programs, and
  302. is designed to interoperate (with, of course, no claim to correct translation)
  303. with Kermit programs that do not support it.
  304.  
  305.  
  306. SPECIFYING THE FILE CHARACTER SET
  307.  
  308. The following command allows the Kermit user to specify the local file
  309. character set:
  310.  
  311.   SET FILE CHARACTER-SET <file-character-set-name>
  312.  
  313. The file character set name is a normally system-dependent item.  Some
  314. computers have only one character set, in which case the SET FILE
  315. CHARACTER-SET command is unnecessary.
  316.  
  317. This command will be required on computers where more than one file character
  318. set is used.  These include private (corporate) character sets or the 7-bit
  319. national variants allowed by ISO Standard 646 (See Appendix B).
  320.  
  321. A consistent, or at least sensible, naming convention should be used for
  322. private character sets.
  323.  
  324. The following names for are recommended for the 7-bit national character sets:
  325. ASCII, BRITISH, CUBAN, DANISH, DUTCH, FINNISH, FRENCH, FRENCH-CANADIAN,
  326. GERMAN, HUNGARIAN, ITALIAN, JAPANESE-ROMAN, NORWEGIAN, PORTUGUESE, SPANISH,
  327. SWEDISH, and SWISS (note: most of these are ISO-646 sets, but several of them
  328. are private 7-bit sets).
  329.  
  330. The Apple character sets might include APPLE-STANDARD, APPLE-QUICKDRAW, and
  331. APPLE-SYMBOL.  The DEC Multinational Character Set can be called
  332. DEC-MULTINATIONAL, DEC Greek would be DEC-GREEK, DEC Hebrew would be
  333. DEC-HEBREW, etc.  The NeXT character set can be NEXT-MULTINATIONAL.  The Data
  334. General international character set can be DATA-GENERAL-MULTINATIONAL, and so
  335. on.  Later, when these companies add new and no doubt unique character sets,
  336. these can be called NEXT-GREEK, NEXT-HEBREW, DATA-GENERAL-GREEK,
  337. DATA-GENERAL-HEBREW, etc.
  338.  
  339. For the IBM character sets (code pages), the notation CPnnn is used, where nnn
  340. is the code page number: CP037, CP437, CP500, CP850, etc.  EBCDIC should be
  341. used for "standard" USA EBCDIC.  An alternative notation, more in keeping with
  342. the ones above, would be something like IBM-PC-STANDARD, IBM-PC-MULTINATIONAL,
  343. IBM-PC-PORTUGUESE, IBM-370-MULTINATIONAL, IBM-370-USA, IBM-370-JAPAN, etc.
  344. But because there are often several code pages that fit one such description,
  345. the CPnnn notation is preferred.
  346.  
  347. These are simply samples and guidelines for naming conventions for corporate
  348. character sets.  File character set names should be both precise and mnemonic
  349. when possible but, as in the IBM case, precision should take precedence.
  350.  
  351. In countries like the USSR, character sets are not associated with particular
  352. companies, but have grown up as a matter of usage in several different
  353. computing environments, or have grown out of several different generations of
  354. standards.  In such cases, it makes the most sense to stick to common usage.
  355. USSR character sets include KOI-7, KOI-8, DKOI, CP866 (Microsoft Cyrillic),
  356. ALT-CYRILLIC ("Alternative Cyrillic"), and CYRILLIC (ISO 8859-5).
  357.  
  358. In Japan, a mixture of standard (JIS), modified standard, and corporate
  359. character sets are used: JIS-7, JIS-8, SHIFT-JIS, JAPAN-EUC, DEC-KANJI, 
  360. FUJITSU-KANJI, HITACHI-KANJI, etc.
  361.  
  362. Example: Consider a computer where the ASCII character set is used for
  363. programming and the German ISO 646 variant is used for text.
  364. The German phrase:
  365.  
  366.    Gr<u-diaeresis><ess-zet>e aus K<o-diaeresis>ln
  367.  
  368. would be rendered in ASCII as "Gr}~e aus K|ln", and the ASCII C-language
  369. phrase "{~a[x]}" would appear as:
  370.  
  371.   <a-diaeresis><ess-zet>a<A-diaeresis>x<U-diaeresis><u-diaeresis>
  372.  
  373. in German ISO 646 (ess-zet is the German double-s character, similar in
  374. appearance to Greek beta).  The German-speaking user would want Kermit to
  375. interpret the local file characters as German (SET FILE CHARACTER-SET GERMAN)
  376. in the former case, and as ASCII (SET FILE CHARACTER-SET ASCII) in the latter.
  377.  
  378.  
  379. SPECIFYING THE TRANSFER CHARACTER SET
  380.  
  381. To select the transfer character set for file transfer, the user enters the
  382. command:
  383.  
  384.   SET TRANSFER CHARACTER-SET <name>
  385.  
  386. where <name> is the name of a standard character set.  If the name is
  387. TRANSPARENT, Kermit does no character set conversion at all, but it still does
  388. text record format conversion.  For ASCII-based systems, this is equivalent to
  389. Kermit's normal, basic mode of operation.
  390.  
  391. If a name other than TRANSPARENT is given, and FILE TYPE is set to TEXT,
  392. Kermit translates between the current file character set and the named
  393. transfer character set when constructing or deciphering file data packets.
  394.  
  395. If the transfer character set is ASCII, Kermit converts between the current
  396. file character set and 7-bit ASCII.  This mode of operation is roughly
  397. equivalent to Kermit's basic mode of operation on non-ASCII based systems like
  398. IBM mainframes.  But if the local file character set contains accented Roman
  399. characters, the accents are dropped in the transfer character set, for example
  400. a-acute becomes simply a.  (But see SET LANGUAGE, described later.)
  401.  
  402. Other transfer character sets must be chosen from among approved national or
  403. international standards.  The sets shown in Table 2 are recommended.  The
  404. criteria for including a character set in this table are:
  405.  
  406. 1. 7-bit US ASCII (= ISO-646 International Reference Version, IRV) is
  407.    included, for compatibility with the original Kermit protocol and the
  408.    hundreds of programs that implement it.
  409.  
  410. 2. An 8-bit single-byte character set, such those in the ISO 8859 series,
  411.    may be included if it is registered, as in (4) below.
  412.  
  413. 3. A multibyte character set may be included, if it is registered as in (4).
  414.  
  415. 4. The set must be listed in the ISO International Register of Character Sets
  416.    under the provisions of ISO Standard 2375 (see Appendix A), so it has a
  417.    unique registration number and designating escape sequence with which the
  418.    sending Kermit program can identify the character set to the receiving
  419.    Kermit program.  (An exception to this provision is made for Japanese EUC,
  420.    which is a combination of two registered standards.)  Allowance is made for
  421.    the possibility of other registration authorities, should they appear.
  422.  
  423. 5. The set must be a national or international standard graphic character
  424.    set, intended for use in computer text processing or programming (as
  425.    opposed to Videotex, Teletex, OCR, device control, or other applications).
  426.    This category may include standard line-drawing or technical character sets
  427.    which fit the other criteria.
  428.  
  429. Note in particular that the national variants of ISO 646 are not included,
  430. since these are covered adequately by the ISO Latin alphabets.
  431.  
  432. Standard character sets containing "composed characters", such as CCITT T.61,
  433. in which an accented letter is represented by a two-character sequence (for
  434. example, c-cedilla is encoded as a cedilla character followed by a "c"
  435. character), are not included at this time.  The issue of composed versus
  436. precomposed characters will be addressed when ISO 10646, the proposed
  437. "Universal Character Set", is finalized.
  438.  
  439. Standard "Kermit names" (for use with the SET TRANSFER CHARACTER-SET command)
  440. are given to these character sets so they may be referred to uniformly in all
  441. Kermit implementations.  These names are chosen to be mnemonic so users don't
  442. have to remember cryptic designations like "ISO-8859-3".  The choice of single
  443. words like "CYRILLIC" implies that there will not be more than one transfer
  444. syntax for Cyrillic text.  However, if standards change in the future, it will
  445. be possible to add further identifying material to these names, e.g.
  446. "CYRILLIC-2, CYRILLIC-ANCIENT", etc.
  447.  
  448. The Kermit names are English, as this is the language of the standards
  449. themselves.  The Kermit commands are English words, and this document is
  450. written in English.  Non-English user interface issues are beyond the scope
  451. of this document.
  452.  
  453. _____________________________________________________________________________
  454.  
  455.             Table 2: Standard Character Sets
  456.  
  457. US 7-bit ASCII.  English, Latin, Gaelic without accents, Dutch without
  458.   y-diaeresis, German without umlauts (vowels marked by diaeresis) or ess-zet.
  459.   Kermit name: ASCII.
  460.   ISO Registration Number: 6.
  461.   Kermit Designator: none (this is the default transfer character set).
  462.  
  463. ISO 8859-1, Latin Alphabet 1.  Danish, Dutch, English, Faeroese, Finnish,
  464.   French, German, Icelandic, Irish, Italian, Norwegian, Portuguese, Spanish,
  465.   and Swedish.
  466.   Kermit name: LATIN1.
  467.   ISO Registration Number: 100.
  468.   Kermit Designator: I6/100.
  469.  
  470. ISO 8859-2, Latin Alphabet 2.  Albanian, Czech, English, German, Hungarian,
  471.   Polish, Romanian, Serbocroatian (Croatian), Slovak, and Slovene.
  472.   Kermit name: LATIN2.
  473.   ISO Registration Number: 101.
  474.   Kermit Designator: I6/101.
  475.  
  476. ISO 8859-3, Latin Alphabet 3.  Afrikaans, Catalan, Dutch, English, Esperanto,
  477.   French, Galician, German, Italian, Maltese, Spanish, and Turkish.
  478.   Kermit name: LATIN3.
  479.   ISO Registration Number: 109.
  480.   Kermit Designator: I6/109.
  481.  
  482. ISO 8859-4, Latin Alphabet 4.  Danish, English, Estonian, Finnish, German,
  483.   Greenlandic, Lappish (Sami), Latvian, Lithuanian, Norwegian, and Swedish.
  484.   Kermit name: LATIN4.
  485.   ISO Registration Number: 110.
  486.   Kermit Designator: I6/110.
  487.  
  488. ISO 8859-5, the Latin/Cyrillic Alphabet.  Bulgarian, Byelorussian, English,
  489.   Macedonian, Russian, Serbocroatian (Serbian), and Ukrainian
  490.   (Compatible with USSR GOST Standard 19768-1987 and ECMA-113).
  491.   Kermit name: CYRILLIC.
  492.   ISO Registration Number: 144.
  493.   Kermit Designator: I6/144.
  494.  
  495. ISO 8859-6, the Latin/Arabic Alphabet.
  496.   Kermit name: ARABIC.
  497.   ISO Registration Number: 127.
  498.   Kermit Designator: I6/127.
  499.  
  500. ISO 8859-7, the Latin/Greek Alphabet.
  501.   Kermit name: GREEK.
  502.   ISO Registration Number: 126.
  503.   Kermit Designator: I6/126.
  504.  
  505. ISO 8859-8, the Latin/Hebrew Alphabet.
  506.   Kermit name: HEBREW.
  507.   ISO Registration Number: 138.
  508.   Kermit Designator: I6/138.
  509.  
  510. ISO DIS 8859-9, Latin Alphabet 5, in which the Icelandic letters Thorn and
  511.   Eth plus upper and lowercase Y acute from Latin Alphabet 1 are replaced by
  512.   six other letters needed for Turkish.  Danish, Dutch, English, Faeroese,
  513.   Finnish, French, German, Irish, Italian, Norwegian, Portuguese, Spanish,
  514.   Swedish, and Turkish.
  515.   Kermit name: LATIN5.
  516.   ISO Registration Number: 148.
  517.   Kermit Designator: I6/148.
  518.  
  519. JIS X 0201, a 1-byte code for Japanese Katakana, used in conjunction
  520.   with a slightly modified ASCII (backslash is replaced by Yen sign,
  521.   tilde by overbar).
  522.   Kermit name: KATAKANA.
  523.   ISO Registration Numbers: 14 (Roman), 13 (Katakana).
  524.   Kermit Designator: I14/13.
  525.  
  526. Japanese EUC
  527.   A variable-length code containing ASCII and Japanese Katakana in their JIS
  528.   X 0201 representations, plus 2-byte JIS X 0208.  JIS X 0208, in turn,
  529.   includes Japanese Kanji, Katakana, Hiragana, Roman, Greek, and Russian
  530.   characters, plus special symbols, etc.  ASCII codes are single bytes with
  531.   their 8th bit set to zero.  JIS X 0208 codes are double bytes with the
  532.   8th bit of each byte set to one.  JIS X 0201 Katakana bytes are preceded
  533.   by Single Shift 2 (see Appendix B).  This mixture allows single-width Roman
  534.   and Katakana characters to coexist with double-width JIS X 0208 characters,
  535.   a common practice in many Japanese computing environments.
  536.   Kermit name: JAPAN-EUC
  537.   ISO Registration Numbers: 14 (Right half of JIS X 0201), 87 (JIS X 0208).
  538.   Kermit Designator: I14/87E.
  539.  
  540. Chinese Standard GB 2312-80, a 2-byte code for Chinese.
  541.   Kermit name: CHINESE.
  542.   ISO Registration Number: 58.
  543.   Kermit Designator: M58.
  544.  
  545. KS C 5601 (1987), a 2-byte code for Korean.
  546.   Kermit name: KOREAN.
  547.   ISO Registration Number: 149.
  548.   Kermit Designator: M149.
  549.  
  550. ISO DIS2 10646.  A multibyte character set intended to cover all the
  551.   world's living languages, and perhaps some dead ones too.  In development.
  552.  
  553.             Table 2: Standard Character Sets
  554. _____________________________________________________________________________
  555.  
  556.     BEWARE: The Latin-4 alphabet is confused. The original ECMA 94 standard
  557.     was designed for the Scandinavian and Baltic languages and thus included
  558.     the character A-ring (necessary for Swedish and Lappish/Sami), but some
  559.     editions of the ISO Registry substitute L-acute (not used by any of the
  560.     covered languages).
  561.  
  562.     NOTE: CNS 11643 (Taiwan) is not included because (a) one Chinese
  563.     transfer character set should be sufficient, and (b) CNS 11643 does not
  564.     show up in the ISO Register.  The issue of "Han Unification" (combining
  565.     Chinese, Japanese, and Korean ideograms into a single code set) is not
  566.     addressed by this proposal, except insofar as it occurs in the base
  567.     multilingual plane (BMP) of ISO 10646.
  568.  
  569.     Until ISO 10646 is finalized and Kermit programs are updated to take
  570.     advantage of it, additional transfer character sets must be added
  571.     to Kermit's repertoire for languages with writing systems not yet
  572.     covered: Burmese, Thai, Lao, Khmer, Vietnamese, Armenian, Georgian,
  573.     Amharic, Sinhalese, Tibetan, Mongolian, Cherokee, many African
  574.     languages, etc etc.
  575.  
  576. The ISO Latin alphabets are 8-bit character sets whose left half is identical
  577. with ASCII, and whose right half contains the characters required for
  578. languages other than English.  All accented letters are "precomposed", i.e.
  579. single code points.  The ISO registration number refers only to the right half
  580. of each of these character sets, but each of these sets must be used in its
  581. entirety, because the unaccented Roman letters, the digits, and the common
  582. punctuation marks appear only in the ASCII left half, which is ALWAYS (unless
  583. otherwise noted) US ASCII, ISO Registration Number 6.  The Kermit
  584. character-set name refers to the two halves combined as a single set.
  585.  
  586. A particular Kermit program need not incorporate all of these character sets.
  587. In many cases, a single 8-bit character set will suffice, such as LATIN1 for
  588. Western Europe, LATIN2 for Eastern European countries with Roman-alphabet
  589. based writing systems, CYRILLIC for most of the USSR, and so on.
  590.  
  591. When a language is representable in more than one character set from this
  592. table, as are English, German, Finnish, Turkish, etc., the character set
  593. highest on the list which adequately represents the language should be
  594. preferred.  More precisely, when a character set other than ASCII is to be
  595. used in Kermit's transfer syntax, the ISO 8859 sets are preferred to other
  596. registered sets which contain the same characters.  Within the ISO 8859
  597. family, lower-numbered sets which contain the characters of interest are
  598. preferred to higher-numbered sets which contain the same characters.  This
  599. guideline maximizes the chance that any two particular Kermit programs will
  600. interoperate.
  601.  
  602. For example, LATIN1 would be chosen for French, German, Italian, Spanish,
  603. Danish, Dutch, Swedish, etc; LATIN3 for Turkish; JAPAN-EUC for Japanese text
  604. that includes Kanji characters, KATAKANA for Japanese text that includes only
  605. Roman and Katakana characters, etc.
  606.  
  607. Unfortunately, but unavoidably, the burden of choosing the best transfer
  608. character set must be placed upon the user.  If a file containing a mixture of
  609. English, Finnish, and Latvian must be transferred, the user must find a
  610. character set that can adequately represent all three languages, in this case
  611. Latin Alphabet 4.  A table like Table 3 should be provided in the user
  612. documentation to help the user make this selection.
  613.  
  614. _____________________________________________________________________________
  615.  
  616.     Afrikaans    LATIN3                       Irish          LATIN1,5
  617.     Albanian     LATIN2                       Italian        LATIN1,3,5
  618.     Arabic       ARABIC                       Japanese Kanji JAPAN-EUC
  619.     Bulgarian    CYRILLIC                     Japan.Katakana KATAKANA,JAPAN-EUC
  620.     Byelorussian CYRILLIC                     Korean         KOREAN
  621.     Catalan      LATIN3                       Lappish (Sami) LATIN4
  622.     Chinese      CHINESE                      Latvian        LATIN4
  623.     Czech        LATIN2                       Lithuanian     LATIN4
  624.     Danish       LATIN1,4,5                   Macedonian     CYRILLIC
  625.     Dutch        LATIN1,2,3,4,5               Maltese        LATIN3
  626.     English      ASCII,LATIN1,2,3,4,5,etc     Norwegian      LATIN1,4,5
  627.     Esperanto    LATIN3                       Polish         LATIN2
  628.     Estonian     LATIN4                       Portuguese     LATIN1,5
  629.     Faeroese     LATIN1,5                     Romanian       LATIN2
  630.     Finnish      LATIN1,4,5                   Russian        CYRILLIC
  631.     French       LATIN1,3,5                  *Serbocroatian  LATIN2, CYRILLIC
  632.     Galician     LATIN3                       Slovak         LATIN2
  633.     German       LATIN1,2,3,4,5               Slovene        LATIN2
  634.     Greek        GREEK                        Spanish        LATIN1,5
  635.     Greenlandic  LATIN4                       Swedish        LATIN1,4,5
  636.     Hebrew       HEBREW                       Turkish        LATIN3,5
  637.     Hungarian    LATIN2                       Ukrainian      CYRILLIC
  638.     Icelandic    LATIN1
  639.  
  640.           Table 3: Preferred Transfer Syntax Character Sets
  641.  
  642. *If written in Cyrillic, this language is called Serbian.  If written
  643.  in Roman letters, it is called Croatian.
  644. _____________________________________________________________________________
  645.  
  646. Note, Table 3 is only a sample.  To produce a comprehensive and definitive
  647. table would require a team of language experts.  The information in the
  648. current table is based purely upon the claims made within the standards
  649. themselves, in which there is no mention of languages like Farsi, Urdu, Welsh,
  650. Cornish, Manx, Inuit, Old Church Slavonic, Armenian, Georgian, Tagalog,
  651. Swahili, Latin, Vietnamese, etc, nor definitions of exactly what is meant by
  652. terms like "Greenlandic", "Irish", etc.  Nevertheless, it is the intention of
  653. this proposal to support any language for which a computer character set can
  654. be standardized.
  655.  
  656.  
  657. OTHER NON-UNIVERSAL CHARACTER SETS
  658.  
  659. This section lists character sets that are not listed in Table 2, but that
  660. are likely candidates for eventual inclusion therein (i.e. after they are
  661. registered with the ISO).
  662.  
  663. ISO 6438, Extended Roman for African Languages.
  664.   More information needed.
  665.  
  666. ISCII-1988, Indian Standard Code for Information Interchange.
  667.   Supports the nine official Indian scripts: Devanagari, Bengali, Gurmukhi,
  668.   Gujarati, Oriya, Tamil, Telugu, Kannada, and Malayalam.  A series of
  669.   single-byte codes with 00/00-07/15 = ASCII, different right halves for each
  670.   script, similar to the ISO family of Latin alphabets, but whose definition
  671.   reportedly changes from time to time.  More information needed (sponsoring
  672.   organization, version number, code tables, etc).  No ISO registration
  673.   number.
  674.  
  675. Viet Nam National Standard
  676.   In preparation.  Vietnamese writing includes approximately 176
  677.   letter+diacritic combinations, which is a tight fit in an
  678.   ISO-4873-conformant character set if all combinations are to receive
  679.   separate code points.
  680.  
  681. (Others?...)
  682.  
  683.  
  684. THE UNIVERSAL CHARACTER SET
  685.  
  686. At this writing, ISO 10646 is still in development.  Even after it is
  687. finalized and approved, it will undergo continuous change as national
  688. standards bodies evolve and engage in the ISO process, and it will take many
  689. years before it replaces the many existing private and standard character sets
  690. in data processing and communication.  Therefore there is no intention to drop
  691. support in the Kermit protocol for the standard character sets listed above at
  692. any time in the foreseeable future.  When approved as an International
  693. Standard, ISO 10646 will be added (in at least in one form, most likely a
  694. compacted version of the two-byte Base Multilingual Plane) to Kermit's list of
  695. transfer character sets.
  696.  
  697.  
  698. IMPLEMENTATION
  699.  
  700. Character set translation can be added to existing Kermit programs with
  701. a minimum of effort.  The following steps are required for each Kermit program:
  702.  
  703. 1. Add the SET FILE TYPE { BINARY, TEXT } command, if the program doesn't
  704.    have it already.  SET FILE TYPE TEXT enables text-file character set
  705.    conversion.  SET FILE TYPE BINARY disables conversions of all kinds, but
  706.    does not destroy the file and transfer character-set selections (2 and 3
  707.    below), so that a subsequent SET FILE TYPE TEXT command will still be able
  708.    to use them.
  709.  
  710. 2. Add the SET FILE CHARACTER-SET <name> command.  The set of <names> should
  711.    include ASCII or EBCDIC (as appropriate, used for program source, etc) plus
  712.    the names of any "national" or special character sets that are used on the
  713.    particular computer.
  714.  
  715. 3. Add the SET TRANSFER CHARACTER-SET <name> command.  The set of <names>
  716.    should include TRANSPARENT and ASCII plus the names of one or more other
  717.    standard character sets from Table 2 which contain the characters from the
  718.    computer's local character set(s).
  719.  
  720. 4. Add translation tables (or functions) between each compatible pair of
  721.    character sets in (2) and (3).  For each pair, two translation tables are
  722.    necessary: one from the local file character set to the transfer character
  723.    set, and one from the transfer set to the local one.
  724.  
  725. 5. Add SHOW commands to let the user find out what character sets are
  726.    available, and which ones are currently selected, for the transfer syntax
  727.    and for local files.  The exact syntax of this command will vary.  In
  728.    some Kermit implementations, every SET command has a corresponding SHOW
  729.    command, in which case it will be possible to SHOW FILE CHARACTER-SET and
  730.    SHOW TRANSFER CHARACTER-SET.  In others, related SET parameters are lumped
  731.    together into broader categories for purposes of SHOW, for example SHOW
  732.    FILE would show all file-related parameters; SHOW PROTOCOL would show all
  733.    protocol-related parameters.
  734.  
  735. Any particular Kermit program can support several (perhaps many) file
  736. character sets (FCS) and transfer character sets (TCS).  No particular
  737. combination of them should be forbidden.  If a useful translation between,
  738. say, Hebrew and Katakana can be devised, there is no reason the user should
  739. not be allowed to select it.
  740.  
  741. However, programs that support large numbers of file and transfer character
  742. sets must bow to the limitations of the computer's architecture and memory
  743. space, as well as the knowledge and patience of the programmer.  Hence, purely
  744. as a matter of implementation, certain combinations of FCS and TCS --
  745. preferably the ones that would be least frequently used -- can remain
  746. unsupported.  In that case, the SET { FILE, TRANSFER } CHARACTER-SET command
  747. that causes the conflict can issue an error message or switch automatically
  748. to a combination (if any) that makes sense.
  749.  
  750. Optionally, several additional related commands can be included:
  751.  
  752. 6. The command SET LANGUAGE may be added to allow the program to apply
  753.    heuristics in the translation process that would not otherwise be possible.
  754.    See discussion below.
  755.  
  756. 7. Commands for modifying, loading, and saving translation tables (to be
  757.    specified in a future draft of this document).
  758.  
  759. 8. Once the new commands and translation tables are in place, it is simple to
  760.    add a TRANSLATE command, to translate a local file from one character set
  761.    to another, using a transfer character set as an intermediate step.  With
  762.    this command, Kermit may be used as a character-set conversion utility for
  763.    local files (see Appendix D).
  764.  
  765. 9. Commands governing automatic pairing of file and transfer character set
  766.    and setting the goal for translation, described below.
  767.  
  768. Translation occurs only in the data field of the D packets.  Packet control
  769. fields are not translated, nor are the data fields of any other kind of
  770. packet, including F (filename) packets.  (Filename packets cannot be
  771. translated because the attribute packet that announces the file's character
  772. set does not arrive until after the F packet.)  As always, IBM Mainframe
  773. Kermit is a special case, since most character strings must be translated
  774. between EBCDIC and ASCII.  Nonetheless, the rule applies even there, as long
  775. as we take "translation" to mean the specific translation between the transfer
  776. and file character sets, rather than the standard ASCII/EBCDIC conversion.
  777.  
  778. Internally, the Kermit program that is sending a file:
  779.  
  780. 1. Reads characters (one or more bytes) or lines of text from the file.
  781.  
  782. 2. Translates the character from the FILE CHARACTER-SET to the TRANSFER
  783.    CHARACTER-SET, applying any selected and applicable special rules or goals,
  784.    and converting the record format if necessary.
  785.  
  786. 3. Follows the negotiated lower-level encoding options: control prefixing,
  787.    shifting, and compression.
  788.  
  789. 4. Assembles and sends the packet.
  790.  
  791. The Kermit program that is receiving a file:
  792.  
  793. 1. Reads an incoming data packet.
  794.  
  795. 2. Decodes the packet data according to the negotiated prefixing, shifting,
  796.    and compression options.
  797.  
  798. 3. Translates the resulting characters from the TRANSFER CHARACTER-SET to the
  799.    FILE CHARACTER-SET, applying any selected and applicable special rules or
  800.    goals, converting the record format if necessary.
  801.  
  802. 4. Writes the translated characters to the output file.
  803.  
  804.  
  805. EXAMPLE
  806.  
  807. To transfer a Finnish-language text file from a computer that uses the Finnish
  808. ISO 646 national variant to an IBM PS/2, and to store the file using the
  809. PS/2's Multilingual Code Page:
  810.  
  811.   On the sending computer:               On the receiving computer:
  812.     SET FILE TYPE TEXT                     SET FILE TYPE TEXT
  813.     SET FILE CHARACTER-SET FINNISH         SET TRANSFER CHARACTER-SET LATIN1
  814.     SET TRANSFER CHARACTER-SET LATIN1      SET FILE CHARACTER-SET CP850
  815.     SEND filename                          RECEIVE
  816.  
  817. The file sender translates from Finnish ISO 646 to Latin Alphabet 1, the
  818. most appropriate transfer character set (see Table 3), and the file receiver
  819. translates from Latin-1 to Code Page 850.
  820.  
  821. To transfer a C-language source program between the same two computers:
  822.  
  823.   On the sending computer:               On the receiving computer:
  824.     SET FILE TYPE TEXT                     SET FILE TYPE TEXT
  825.     SET TRANSFER CHARACTER-SET ASCII       SET FILE CHARACTER-SET ASCII
  826.     SET FILE CHARACTER-SET ASCII           SET TRANSFER CHARACTER-SET ASCII
  827.     SEND filename                          RECEIVE
  828.  
  829. Here all translations are from ASCII to ASCII, hence no translation at all.
  830.  
  831.  
  832. LANGUAGE-SPECIFIC TRANSLATIONS
  833.  
  834. When national or international text must be translated into ASCII, information
  835. is necessarily lost.  ASCII does not include accented or non-Roman letters.
  836. For readability, accented letters can be converted to their unaccented
  837. counterparts, but that can introduce ambiguities or mistakes (to use Andr'e
  838. Pirard's example: "a la francaise" without accents means "has the French
  839. girl").  If we know that the text is written in a specific language, sometimes
  840. certain language-specific rules can be applied to reduce the loss of
  841. information.
  842.  
  843. For example, consider text containing the y-diaeresis character.  It is
  844. acceptable to render y-diaeresis as "ij" if the language is Dutch, but not
  845. otherwise (yielding "Rijksmuseum" -- correct spelling -- rather than
  846. "Ryksmuseum").  Similarly, o-diaeresis can be rendered as "oe" in German or
  847. Swedish but not in English ("co<o-diaeresis>peration").
  848.  
  849. The command for selecting language-specific translation rules is:
  850.  
  851.    SET LANGUAGE <name>
  852.  
  853. where <name> is the (English) name of the language, for example ITALIAN,
  854. NORWEGIAN, PORTUGUESE.
  855.  
  856. Example: The command SET LANGUAGE GERMAN would allow the Kermit program, when
  857. translating from Latin-1 or the German ISO 646 variant into ASCII, to render:
  858.  
  859.    Gr<u-diaeresis><ess-zet>e aus K<o-diaeresis>ln
  860.  
  861. as "Gruesse aus Koeln" (correct German) rather than "Gruse aus Koln" (Gruse
  862. means something entirely different from Gruesse -- something like "scum"
  863. rather than "greetings").
  864.  
  865.  
  866. TRANSLATION MECHANISMS
  867.  
  868. When translating from one character set to another, there are two goals
  869. possibly conflicting goals:
  870.  
  871. 1. Readability (R): Achieving a translation that makes the most sense to
  872.    the reader.
  873.  
  874. 2. Invertibility (I): Achieving a translation that can be translated back
  875.    to the original character set without loss or distortion of information.
  876.  
  877. When readability is desired, nonmatching characters are converted to the
  878. closest matching character, for example Latin-1 e-grave becomes simply e in
  879. ASCII.  But now "e" represents two different characters in the translation, so
  880. invertibility is lost.  When no sensible counterpart exists, a special "this
  881. can't be translated" character is used (a unique character if possible,
  882. otherwise a question mark "?").  When this special character is used for more
  883. than one purpose, invertibility is lost.
  884.  
  885. Invertibility is possible only when both character sets are the same size.
  886. When invertibility is desired, the characters of the intersection of the two
  887. sets are paired together: A in one set to A in the other, A-grave in one set
  888. to A-grave in the other, etc.  The disjoint areas of the two sets are paired
  889. together in a way that gives every character a unique translation in each
  890. direction.  The exact method for pairing is problematic, and frequently a
  891. particular pair makes no sense at all, for example "L-with-stroke" with
  892. "Vulgar fraction 3/4".
  893.  
  894. Let's look at a few common translation scenarios.
  895.  
  896. 1. From a 7-bit set to a different 7-bit set, e.g. from ISO 646 Spanish
  897.    version to ASCII (or vice versa).  The two sets do not contain the same
  898.    characters.  Here we must choose between readability and invertibility.  To
  899.    achieve readability in the Spanish-to-ASCII direction, we strip diacritical
  900.    marks (n-tilde becomes simply n).  To achieve invertibility (at least in
  901.    this case), we make no translation at all.
  902.  
  903. 2. From a 7-bit set to an 8-bit set.  The 7-bit sets are usually ASCII or an
  904.    ISO 646 national variant.  Normally, all the characters from the 7-bit set
  905.    are also present in the 8-bit set, and there is no R vs I conflict.  If
  906.    not, we must choose between R and I.  Normal example: ASCII (and most ISO
  907.    646 national variants) to Latin-1 -- here we satisfy both R and I.
  908.    Bizarre example: ISO 646 Swiss national variant to ISO Latin / Arabic --
  909.    here we must choose between R and I.
  910.  
  911. 3. From an 8-bit set to another 8-bit set.  The common case here is converting
  912.    between one of the corporate "extended ASCII" sets (DEC, IBM, Apple, NeXT,
  913.    Data General, Commodore, etc) and ISO Latin-1.  The two sets share a large
  914.    percentage of common characters.  How do we handle the characters that
  915.    differ?  Again, we must choose between R and I.
  916.  
  917. 4. From an 8-bit set to a 7-bit set.  For example, from Latin-1 to ASCII or to
  918.    an ISO 646 national set.  Here we are forced to accept a great deal of
  919.    information loss.  We cannot possibly achieve invertibility, so we should
  920.    aim for maximum readability.  The SET LANGUAGE command can be used to help.
  921.  
  922. 5. From a single-byte character set to a multibyte character set.  Most
  923.    multibyte character sets include ASCII and sometimes several other
  924.    alphabets (such as Greek and Cyrillic in JIS X 0208).  Here we translate
  925.    each character into its equivalent, if it has one, and if not we pick some
  926.    unique nonsense value to ensure the translation is invertible (for the
  927.    single-byte set).
  928.  
  929. 6. From a multibyte set to a single-byte set, for example Japanese EUC
  930.    into Latin-1 (or Latin/Cyrillic, Latin/Greek, or even ASCII).  Here we
  931.    lose the vast majority of characters -- there is no hope for a readable
  932.    or even a sensible translation.  The only way to translate Kanji into
  933.    (say) ASCII is to replace ideograms by words, and that is beyond the
  934.    scope of a simple character-set conversion scheme.
  935.  
  936. 7. From one national multibyte set to another.  These sets are for Chinese,
  937.    Japanese, and Korean, and have at least a large number of ideograms (Han
  938.    characters) in common, and probably also Roman characters.  How to
  939.    translate among them is an item for study by language experts.
  940.  
  941. 8. From a particular character set to a universal character set, or vice
  942.    versa.  Let's worry about this one when the universal character set arrives.
  943.  
  944. How do we choose between readability and invertibility?  It depends on what
  945. the user needs at a particular moment.  We (Kermit designers and programmers)
  946. can give the user the ability to make this choice.  Or we can make the choice
  947. for them, knowing full well that whatever our choice, it will be wrong.
  948.  
  949. To give the user a choice -- at the expense of increased size and complexity
  950. in the program itself and of the user interface -- the following command can
  951. (optionally) be included:
  952.  
  953.    SET TRANSFER TRANSLATION { INVERTIBLE, READABLE }
  954.  
  955. The existence of this command requires a dual set of translation tables and/or
  956. functions -- one optimized for invertibility (totally invertible if the two
  957. character sets are the same size), the other for readability.  When a Kermit
  958. program handles many character sets, this can result in a significant increase
  959. in size.
  960.  
  961. When this command is not provided, the bias of the translation mechanisms --
  962. readability or invertibility -- must be stated clearly in the user
  963. documentation.
  964.  
  965. It is a matter of choice to the programmer whether translation is accomplished
  966. by tables or by functions which implement translation algorithms, or a
  967. combination of both.  Functions provide maximum flexibility and tend to reduce
  968. program size, at some cost in execution overhead.  Tables provide greatest
  969. speed, but with generally greater cost in program size.
  970.  
  971.  
  972. THE POLITICS OF INVERTIBILITY
  973.  
  974. if two character sets are the same size and contain the exact same
  975. repertoire of characters, translation is simply a matter of rearranging
  976. code points.  But when two character sets are intended to serve the same
  977. language or group of languages, but differ on non-alphabetic code points or in
  978. other minor ways, arbitrary decisions must be made in assigning the
  979. nonoverlapping characters from the two sets.  Who makes those decisions?
  980.  
  981. The classic example is the translation between IBM Code Page 850 (the
  982. "Multilingual Code Page") and ISO Latin-1.  Because IBM assigns graphics
  983. characters to its C1 area, it has 32 more graphics characters than Latin-1.
  984. Most of these are line- and box-drawing characters sprinkled throughout
  985. the code page.  How should these be paired with Latin-1's C1 set?
  986.  
  987. Such decisions are beyond the scope of the national and international
  988. standards bodies, nor should they be made by Kermit designers or programmers.
  989. These tables (or algorithms) are most appropriately furnished by the creators
  990. of each private character set.  This lends the appropriate "official" air, and
  991. encourages the makers of all software packages that need such a translation to
  992. use the official one so all such applications on a particular computer can
  993. interoperate.
  994.  
  995. IBM should specify an invertible translation between each of its Roman-based
  996. code pages and Latin-1 (and/or -2, -3, -4, -5, etc).  Similarly, Apple should
  997. specify the translation between Quickdraw and Latin-1.  Microsoft should
  998. specify the translation between CP 866 and the Latin / Cyrillic alphabet.  And
  999. so on.  In the absence of such vendor-provided translations, Kermit
  1000. programmers must produce their own, while continueing to press vendors for
  1001. official versions.
  1002.  
  1003. Eventually, the actual contents of each invertible translation table or
  1004. algorithm should be specified in a document or set of documents to accompany
  1005. this proposal, or references to the relevant corporate standards should be
  1006. provided.
  1007.  
  1008. Before leaving this topic, let's also remember to encourage designers of
  1009. computer operating systems to RECORD THE CHARACTER SET in a text file's
  1010. directory entry, so Kermit or any other application program can find out what
  1011. it is automatically without requiring the user to identify it manually.  (Of
  1012. course, this begs the larger question of recording the file type as well...
  1013. item for futher study.)
  1014.  
  1015.  
  1016. THE POLITICS OF READABILITY
  1017.  
  1018. Similarly, we can ask: Who decides what is readable?  Transliteration of a
  1019. language like Greek or Russian into ASCII can be done in many different ways,
  1020. depending upon -- among other things -- the language spoken by the person
  1021. reading the result.  For example, the surname of a former leader of the USSR,
  1022. which, when written in Cyrillic, has only six letters; transliterated into
  1023. English, the name is "Khrushchev".  Into German, "Khruschtschew".
  1024.  
  1025. There are few, if any, widely recognized standards for transliteration, and
  1026. yet it is often desirable.  Newspapers and magazines, library catalogers,
  1027. immigrant bureaus, and many other organizations have procedures for
  1028. transliterating "foreign" writing systems.  Not just in "ASCII-speaking"
  1029. lands, but everywhere: Russian names are written in Arabic newspapers, Hebrew
  1030. names in Greek journals, English names on Chinese passports, Korean
  1031. publications in Vietnamese library catalogs.
  1032.  
  1033. When a translation function is optimized for readability -- and some must be
  1034. -- the designer must consider whether to force a particular kind of
  1035. readability on the user, or to give the user a choice.  The precise mechanism
  1036. for this (if indeed any such mechanism can be precise!) is another topic for
  1037. further study: How to best transliterate from Language A in Writing System B
  1038. in Character Set C to Language X in Writing System Y in Character Set Z?
  1039.  
  1040.  
  1041. USER-DEFINED TRANSLATIONS
  1042.  
  1043. It should be possible for users to override the decisions made by Kermit
  1044. programmers regarding the bias of the translation mechanisms or its particular
  1045. details, as well as to add totally new translations.
  1046.  
  1047. Methods used to do this will be described in a future draft of this document.
  1048. This is primarily a user-interface design issue.
  1049.  
  1050.  
  1051. ATTRIBUTE PACKETS
  1052.  
  1053. We want to accommodate as many computers as possible with a minimum of
  1054. programming effort, but this approach places a burden on the user in the
  1055. form of new commands and the confusion which results if the user forgets to
  1056. issue these commands.
  1057.  
  1058. This protocol extension does not require support for Kermit File Attribute
  1059. Packets, whose use is negotiated in the Kermit Initialization exchange, but
  1060. their use is recommended; the user's burden can be alleviated if the sending
  1061. Kermit program uses an attribute field to inform the receiving Kermit of the
  1062. character set used in the file data packets.  The receiving program can
  1063. accept or refuse the file based on whether it supports the specified
  1064. character set.  If the receiving program refuses a file, the user can
  1065. override this refusal, for example, if a long file contains only a word or
  1066. two in an unknown character set.  The most common user-override is the
  1067. command SET ATTRIBUTES OFF.  However, this also disables other desirable
  1068. effects of attribute packets, such as prenotification of file size.
  1069. Therefore, it is desirable to let the user specify exactly which attributes
  1070. are to be "turned off", e.g., SET ATTRIBUTES ENCODING OFF.
  1071.  
  1072. When the transfer character set is ASCII (or TRANSPARENT when sent from an
  1073. ASCII-based system), the Encoding attribute should have the traditional value
  1074. of "A" (for ASCII): "*!A".
  1075.  
  1076. In order for the sender to inform the receiver of transfer character sets
  1077. other than ASCII, a new value for the Encoding attribute ("*") is defined,
  1078. namely "C", which is substituted for the normal value "A" (ASCII).  "C" means
  1079. that the actual character set is specified as an operand which begins with a
  1080. single letter that designates the character set registration authority, e.g.
  1081. I for ISO, followed by a registration-authority-specific identifier, as in:
  1082.  
  1083.   Ixxx/yyy
  1084.  
  1085. where the letter "I" (for ISO) is followed by a pair of ISO registration
  1086. numbers for the character set, xxx for the "left half" and yyy for the right,
  1087. expressed in decimal ASCII digits, for example:
  1088.  
  1089.   +---+---+---+--------+
  1090.   | * | ' | C | I6/100 |
  1091.   +---+---+---+--------+
  1092.  
  1093. where "*" is code for the Encoding Attribute (or transfer syntax), "'" is the
  1094. length of its value.  In this case, "CI6/100" is 7 characters long, and
  1095. "'" is the printable encoding for 7 (7 + 32 = 39, the ASCII code for "'").
  1096. The character "C" means "I'm using the specified Character set", and
  1097. "I6/100" specifies the character set: "ISO registration number 6", i.e. US
  1098. ASCII, in the left half, and ISO registration number 100, which is the right
  1099. half of Latin-1, in the right.  The "I" stands for ISO, and is included to
  1100. allow for the possibility of other character set registration authorities.
  1101. Designators for each character set are given in Table 2, labeled "Kermit
  1102. Designator".
  1103.  
  1104. For self-contained ISO standard multibyte character sets, the Kermit
  1105. Designator starts with the letter "M", rather than "I", to indicate (a) that
  1106. it is a multibyte, rather than single-byte, set and (b) that there is no "left
  1107. half", i.e. "M" is always followed by a single ISO registration number.
  1108.  
  1109. Japanese EUC is a special case, because it is a mixture of single-byte JIS X
  1110. 0201 and double-byte JIS X 0208.  Its Kermit designator is I14/87E.
  1111.  
  1112. In the event that a character set standard changes, but keeps the same
  1113. registration number, the registration number for the new character set should
  1114. be preceded by a non-numeric character which indicates the revision number: @
  1115. (atsign) = 1, A=2, B=3, and so on (as suggested in ISO 2022).  For example
  1116. "I@2/B100" would indicate an 8-bit single-byte character set having Revision
  1117. 1 of ASCII as its left half and Revision 3 of Latin-1 as its right.  Note:
  1118. "Revision 1" does not mean the original version, but rather the first
  1119. revision AFTER the original version.  The Kermit designator for an original
  1120. version does not have a revision indicator.
  1121.  
  1122. The form of the character-set designator was chosen because the standards
  1123. currently provide no single code to designate an 8-bit character set in its
  1124. entirety.  Each half of the character set has its own registration number.
  1125. For example, ISO 8859-1 (Latin-1) is a single 8-bit character set, but
  1126. registration number 100 only refers to its right half.  Registration number 6
  1127. denotes ASCII, which is used as the left half of all ISO 8859 character sets.
  1128.  
  1129. To promote maximum interoperability among extended Kermit programs, the
  1130. Kermit designator should be treated as a character string, to be looked up in
  1131. a small table, rather than as a flexible mechanism to be used for piecing
  1132. together character sets from an arbitrary assortment of left and right
  1133. halves.  However, the Ixxx/yyy notation leaves open this possibility should
  1134. it become desirable at a later time.
  1135.  
  1136. In the event that a new class of registration numbers appears, for example, to
  1137. denote a single-byte 8-bit character set in its entirety rather than just its
  1138. left or right half, a different initial letter will be used in the designator,
  1139. even if the registration authority is the ISO.  In the event that other
  1140. character-set registration authorities appear, they too can be assigned their
  1141. own unique Kermit designator prefixes (for example, "K" for Kermit Development
  1142. and Distribution), to avoid ambiguity from conflict of registration numbers.
  1143. For the present, standards organizations like ANSI and CCITT are not treated
  1144. as separate registration authorities, because their character sets are also
  1145. registered by the ISO.  Should these organizations adopt character sets that
  1146. have no ISO counterpart, then special Kermit designator prefixes will be
  1147. assigned for them.
  1148.  
  1149. Based on the attribute information, the receiver may accept or reject the
  1150. file, using Kermit's normal attribute response mechanism.  To accept, it puts
  1151. a "Y" as the first character of the data field of the acknowledgement to the
  1152. attribute packet.  To refuse, it puts an "N" instead of a "Y", followed by
  1153. "*".  If the file is refused in this manner, the sending Kermit should respond
  1154. by sending a "Z" (end-of-file) packet containing a "D" (for Discard) in its
  1155. data field.
  1156.  
  1157. The behavior of the receiving Kermit program when an unknown character set
  1158. is announced to it is governed by the command SET UNKNOWN-CHARACTER-SET.
  1159. SET UNKNOWN-CHARACTER-SET KEEP means that it should not reject the file, but
  1160. store it the best way it can (e.g., without translating any characters),
  1161. DISCARD means that the file should be rejected.
  1162.  
  1163. It is recognized that there are presently Kermit implementations in the USSR,
  1164. Japan, and elsewhere that use character sets other than the ones listed in
  1165. Table 2 in their transfer syntax, and/or sets that are not listed in the
  1166. International Register.  It is recommended that these Kermit programs be
  1167. converted to use the recommended standard character sets, or if there is a
  1168. strong reason why this cannot be done, that these character sets be registered
  1169. with Kermit Development and Distribution at Columbia University.
  1170.  
  1171.  
  1172. AUTOMATIC SELECTION OF FILE CHARACTER-SET BY THE FILE RECEIVER
  1173.  
  1174. When a file arrives whose transfer character-set is announced in the attribute
  1175. packet, it is desirable to include a mechanism to allow the receiving Kermit
  1176. program to select the most appropriate file character-set automatically.
  1177. Similarly, if the user gives a SET FILE CHARACTER-SET command, it would be
  1178. desirable to switch to an appropriate TRANSFER CHARACTER-SET automatically,
  1179. and vice-versa.  Any such mechanism should also include a "manual override"
  1180. to let the user disable it.
  1181.  
  1182. Suppose, for example, an MS-DOS Kermit program that is about to receive a file
  1183. has CP437 as its FILE CHARACTER-SET, but the arriving file is announced as
  1184. CYRILLIC.  The receiving Kermit can (a) translate the Cyrillic characters into
  1185. ASCII using a transliteration scheme (like "Short KOI" phonetic
  1186. transcription), or (b) switch its file character set to one that contains the
  1187. greatest number of characters that are also in the transfer character set, in
  1188. this case CP866.
  1189.  
  1190. We can design Kermit programs to supply translations between every possible
  1191. combination of file and transfer character set.  Or we can allow only certain
  1192. combinations, for example Roman-to-Roman, Cyrillic-to-Cyrillic,
  1193. Hebrew-to-Hebrew, etc.
  1194.  
  1195. In the former case, it is the user's responsibility to choose the most useful
  1196. combination.  In the latter, the receiving Kermit must either reject the file
  1197. when the file character set is not valid for the incoming transfer character
  1198. set (or accept it without translation, depending on the setting of
  1199. UNKNOWN-CHARACTER-SET), or else switch to an appropriate file character set
  1200. automatically.
  1201.  
  1202. An optional automatic switching mechanism, configurable by the user, can be
  1203. provided, with the following command:
  1204.  
  1205. SET SEND AUTOMATIC-TRANSLATION { OFF, ON, <FCS> [ <TCS> ] }
  1206.     Automatic translation action when sending files.
  1207.     OFF means don't automatically switch translations.
  1208.     ON means enable automatic translation.
  1209.     <FCS> <TCS> means: If the current file character set is <FCS>, then use
  1210.     <TCS> as the transfer character set.  If <TCS> is omitted, automatic
  1211.     selection of a transfer character set for <FCS> is not done, and the
  1212.     current transfer character set is used.  In either case, any previous
  1213.     entry for <FCS> is superseded.
  1214.  
  1215. SET RECEIVE AUTOMATIC-TRANSLATION { OFF, ON, <TCS> [ <FCS> ] }
  1216.     Automatic translation action when receiving files.
  1217.     OFF means don't automatically switch translations.
  1218.     ON means enable automatic translation.
  1219.     <TCS> <FCS> means: if the announced transfer character set of the incoming
  1220.     file is <TCS>, then use <FCS> as the file character set.  If <FCS> is
  1221.     omitted, automatic selection of a file character set for <TCS> is not
  1222.     done, and the current file character set is used.  In either case, any
  1223.     previous entry for <TCS> is superseded.
  1224.  
  1225. Many of these commands can be executed.  Their effect is to build a pair of
  1226. lookup tables.  When AUTOMATIC-TRANSLATION is OFF, or the character set is not
  1227. found in these tables, the prevailing settings are used.  ON can be used to
  1228. enable any tables that had been previously disabled by OFF.
  1229.  
  1230. The programmer may preload the Kermit program with a default set of tables.
  1231. However, the default AUTOMATIC-TRANSLATION setting in both directions should
  1232. be OFF.
  1233.  
  1234.  
  1235. INTEROPERABILITY WITH UNEXTENDED KERMIT PROGRAMS
  1236.  
  1237. Extended Kermit programs must be fully interoperable with unextended ones.
  1238. When the file sender is extended and the receiver is not, the receiver ignores
  1239. the encoding attribute and stores the file data as received, but after
  1240. applying any required record-format conversions.  In case the sender's
  1241. encoding attribute causes problems for the receiver, the sending Kermit should
  1242. have an option to omit this attribute: SET ATTRIBUTE ENCODING OFF (or as a
  1243. last resort, SET ATTRIBUTES OFF altogether).  The sender has the option of
  1244. translating from a local file character set to any desired transfer character
  1245. set, including ASCII, that will be useful on the receiving computer.
  1246.  
  1247. When the file receiver is extended and the sender is not, the receiver has the
  1248. option of translating the received characters to a local file character set.
  1249. This will be useful if the character set used in the packets corresponds with
  1250. one of the receiver's transfer character sets, and it requires the user to
  1251. manually inform the receiving Kermit of both the transfer and the file
  1252. character sets.
  1253.  
  1254. In other cases, the extended Kermit's TRANSLATE command can be used to
  1255. pre- or postprocess a file to achieve the desired results if the desired
  1256. translations are available.
  1257.  
  1258.  
  1259. PERFORMANCE
  1260.  
  1261. There is nothing in this proposal that affects the performance of the Kermit
  1262. file transfer protocol.  The efficiency of file transfer is the same with
  1263. or without this extension.
  1264.  
  1265. However, it is recognized that transfer of 8-bit text will not always be
  1266. efficient.  Since the special characters have their 8th bits set to one, there
  1267. will be a lot of 8th-bit prefixing in the 7-bit environment -- the higher the
  1268. proportion of special characters to ASCII characters, the lower the
  1269. efficiency.  For "left-handed" languages like Italian, Norwegian, and
  1270. Portuguese (in which the preponderance of text characters are ASCII), the
  1271. impact is negligible.  For "right-handed" languages like Russian, Greek,
  1272. Hebrew, and Arabic, in which all letters come from the right half of the
  1273. character set, efficiency will be poor in the 7-bit environment.  The
  1274. situation is even worse for Japanese EUC, in which all Kanji bytes have their
  1275. 8th bit set to 1.
  1276.  
  1277. For this reason, it is recommended that Kermit programs that implement
  1278. transfer character sets for non-Roman-based writing systems also include
  1279. Kermit's locking shift protocol, which is specified and analyzed in a separate
  1280. document.
  1281.  
  1282.  
  1283. TERMINAL EMULATION
  1284.  
  1285. While not part of the Kermit file transfer protocol, terminal emulation is an
  1286. essential feature of many Kermit programs.  It is hoped that all of Kermit's
  1287. terminal emulators will evolve along the lines of the ISO standards described
  1288. in the Appendices.  In some cases, this is already a fact, insofar as DEC
  1289. VT200 and 300 series terminals already follow these standards and Kermit
  1290. programs are available that emulate these terminals.
  1291.  
  1292. The following Kermit commands are recommended for terminal emulation:
  1293.  
  1294. SET TERMINAL TYPE <name>
  1295.   Identify the type of terminal to be emulated, for example VT320.
  1296.  
  1297. SET TERMINAL BYTESIZE <number>
  1298.   Tell how many bits of each arriving character are to be displayed on the
  1299.   screen.  This command is used to protect the user from parity bits sent by
  1300.   the host during terminal emulation, even when PARITY is set to NONE, so the
  1301.   normal setting is 7.  SET TERMINAL BYTESIZE 8 allows reception of 8-bit
  1302.   bytes.
  1303.  
  1304. SET TERMINAL CHARACTER SET <remote-character-set> [ <local-character-set> ]
  1305.   Tell how to translate characters during terminal emulation.  The
  1306.   <remote-character-set> denotes the codes sent by, and expected by, the
  1307.   remote host.  The <local-character-set>, if given, specifies the character
  1308.   codes generated by the local keyboard and displayed on the local screen.
  1309.   If the <local-character-set> is not specified, the current FILE
  1310.   CHARACTER-SET should be used.  Since it is likely that neither one of
  1311.   the two character sets is a standard (TRANSFER) character set, the terminal
  1312.   emulator cannot always use Kermit's built-in file translation tables or
  1313.   functions directly.  However, it is often possible to use them in a
  1314.   two-step process, using one of Kermit's transfer character sets as an
  1315.   intermediary.
  1316.  
  1317. SET TERMINAL TRANSLATION { INVERTIBLE, READABLE }
  1318.   Specifies the desired style of character translation to use during
  1319.   terminal emulation.
  1320.  
  1321. SET LANGUAGE
  1322.   Should not apply to terminal emulation -- characters should not be added
  1323.   or deleted during translation, because that would interfere with the
  1324.   formatting of the screen.
  1325.  
  1326. SET TERMINAL DIRECTION { LEFT-TO-RIGHT, RIGHT-TO-LEFT }
  1327.   Specifies the direction of screen writing during terminal emulation.
  1328.   RIGHT-TO-LEFT can be used for Hebrew and Arabic.
  1329.  
  1330. SET TERMINAL LOCKING-SHIFT { ON, OFF }
  1331.   Specifies whether the terminal emulator should use locking shifts
  1332.   (normally SO/SI) when sending and receiving 8-bit data in the 7-bit
  1333.   communications environment.  This behavior is built in to certain
  1334.   terminal emulators (such as VT220, VT320); this command is for use
  1335.   with terminal emulators that do not have this capability built in.
  1336.  
  1337. SET TRANSLATION INPUT \aaa \bbb
  1338.   Specify that when the character \aaa is received from the communication
  1339.   medium, it should be translated to \bbb before display on the screen.
  1340.   Many such commands can be given, allowing the user to form a custom-made
  1341.   terminal character set.
  1342.  
  1343. SET KEY \sss \vvv
  1344.   Specify that when the key whose value is sss is pressed, the Kermit program
  1345.   sends the code \vvv.  Many such commands can be given, allowing the user
  1346.   to customize the keyboard for any desired character set.  The value can be
  1347.   a single character or a string of characters.
  1348.  
  1349. Terminal character-set translation should be used in screen capture (session
  1350. logging), non-transparent screen-print operations, and "raw uploading" of
  1351. text files (TRANSMIT command, when FILE TYPE is TEXT).  Character-set
  1352. translation should NOT be used in scripting commands such as INPUT and OUTPUT.
  1353.  
  1354.  
  1355. APPENDIX A: STANDARDS
  1356.  
  1357. ANSI X3.4-1986, "Coded Character Sets - 7-bit American Standard Code for
  1358.   Information Interchange" (US ASCII), is the 7-bit code currently used by
  1359.   Kermit for transferring text files.
  1360.  
  1361. ISO 646 (1983) (= ECMA-6), "Information Processing - ISO 7-bit Coded Character
  1362.   Sets for Information Interchange", gives us a 7-bit character set equivalent
  1363.   to ASCII with provision for substituting "national characters" in selected
  1364.   positions.
  1365.  
  1366. ISO 4873 (1986) (= ECMA-43), "Information Processing - ISO 8-bit Code for
  1367.   Information Interchange - Structure and Rules for Implementation", defines
  1368.   8-bit character sets, their graphic and control regions, and how to extend
  1369.   an 8-bit character set by using multiple intermediate graphics sets.
  1370.  
  1371. ANSI X3.134.1 (1991), "8-Bit ASCII - Structure and Rules", the USA equivalent
  1372.   of ISO 4873.
  1373.  
  1374. ISO 2022 (1986) (= ECMA-35), "Information Processing - ISO 7-bit and 8-bit
  1375.   Coded Character Sets - Code Extension Techniques", describes how to use
  1376.   8-bit character sets in both 7-bit and 8-bit environments, and how to switch
  1377.   among different character sets.
  1378.  
  1379. ISO International Register of Coded Character Sets to be Used with Escape
  1380.   Sequences.  This is the source of the ISO registration numbers.
  1381.  
  1382. ISO 2375 (1985) "Data Processing - Procedure for Registration of Escape
  1383.   Sequences".  The procedure by which a character set gets into the above
  1384.   register and has a registration number and designating escape sequence
  1385.   assigned to it.
  1386.  
  1387. JIS X 0202, "Code Extension Techniques for Use the Code for Information
  1388.   Interchange", the Japanese counterpart of ISO 2022.
  1389.  
  1390. ISO 6429-1983, "C1 Control Character Set".
  1391.  
  1392. ANSI X3.41-1974, "Code Extension Techniques for Use with the 7-Bit Coded
  1393.   Character Set of the American National Standard Code for Information
  1394.   Interchange", describes 7- and 8-bit codes and extension techniques in
  1395.   approximately the same manner as ISO 4873 and ISO 2022.  (Now obsolete?)
  1396.  
  1397. ISO 8859 (1987-present) (see Table 6 for ECMA equivalents), "Information
  1398.   Processing - 8-Bit Single-Byte Coded Graphic Character Sets", defines the
  1399.   actual 8-bit character sets to be used for many of the world's languages.
  1400.   The left half of each of these is the same as ASCII and ISO 646 IRV.  Each
  1401.   character, including those with diacritics, is represented by a single byte.
  1402.  
  1403. ANSI X3.134.2 (1991), "7-Bit and 8-Bit ASCII Supplemental Multilingual
  1404.   Graphic Character Set", the USA equivalent of ISO 8859-1.
  1405.  
  1406. JIS X 0201, Japanese Roman / Katakana set (need full reference).
  1407.  
  1408. JIS X 0208, Japanese Kanji set (need full reference).
  1409.  
  1410. JIS X 0212, Japanese Kanji set (superset of JIS X 0208, reportedly not in
  1411.   use at all, need full reference).
  1412.  
  1413. ISO is the International Standardization Organization, ANSI is the American
  1414. National Standards Institute, ECMA is the European Computer Manufacturers
  1415. Association.  JIS means Japan Industrial Standard.
  1416.  
  1417. The ISO/ECMA standards discussed in this proposal may be obtained free of
  1418. charge in their ECMA form by writing to:
  1419.  
  1420.   ECMA Headquarters
  1421.   Rue du Rhone 114
  1422.   CH-1204 Geneva
  1423.   SWITZERLAND
  1424.  
  1425. Be sure to specify the title and the ECMA number of each standard requested.
  1426.  
  1427. In general, the ISO member body from each country acts as the local sales
  1428. agent for ISO Standards in that country, for example ANSI in the USA:
  1429.  
  1430.   Sales Department
  1431.   American National Standards Institute
  1432.   1430 Broadway
  1433.   New York, NY  10018
  1434.   Telephone 212-354-3300
  1435.  
  1436. Each such organization has its own arrangements for disseminating printed
  1437. documents.  ANSI sells them for US dollars; organizations in other countries
  1438. may either sell them for local currency or give them away, depending on how
  1439. they are funded to operate.
  1440.  
  1441. ISO standards and CCITT recommendations can also be ordered from the UN
  1442. bookstore, but not free of charge:
  1443.  
  1444.   United Nations Bookstore
  1445.   United Nations Building
  1446.   New York, NY  10017
  1447.  
  1448. CCITT recommendations are also available by mail order from ANSI.
  1449.  
  1450. CCITT recommendations are also available via anonymous FTP on the Internet
  1451. from host BRUNO.CS.COLORADO.EDU or DIGITAL.RESOURCE.ORG in the directory
  1452. /pub/standards/ccitt/.
  1453.  
  1454.  
  1455. APPENDIX B: HOW THE STANDARDS WORK
  1456.  
  1457. ASCII and ISO 646 give us a 128-character 7-bit character set.  This set is
  1458. divided into two parts:
  1459.  
  1460.   1. 33 "control characters" (characters 0 through 31, and character 127).
  1461.   2. 95 "graphic characters" (32-126).
  1462.  
  1463. Graphic characters make ink appear on the page or phosphor glow on the screen.
  1464. Control characters are used as fillers or format effectors and for
  1465. transmission or device control.  The ASCII / ISO-646 IRV character set is
  1466. shown in Figure 1, arranged in a table of 16 rows and 8 columns.  The graphic
  1467. characters are shown literally (except SP stands for the space character), the
  1468. control characters by name (control character names and functions are defined
  1469. in ISO 646).
  1470.  
  1471. _____________________________________________________________________________
  1472.  
  1473.       00  01  02  03  04  05  06  07
  1474.      +---+---+---+---+---+---+---+---+
  1475.   00 |NUL DLE| SP  0   @   P   `   p |
  1476.   01 |SOH DC1| !   1   A   Q   a   q |
  1477.   02 |STX DC2| "   2   B   R   b   r |
  1478.   03 |ETX DC3| #   3   C   S   c   s |
  1479.   04 |EOT DC4| $   4   D   T   d   t |
  1480.   05 |ENQ NAK| %   5   E   U   e   u |
  1481.   06 |ACK SYN| &   6   F   V   f   v |
  1482.   07 |BEL ETB| '   7   G   W   g   w |
  1483.   08 |BS  CAN| (   8   H   X   h   x |
  1484.   09 |HT  EM | )   9   I   Y   i   y |
  1485.   10 |LF  SUB| *   :   J   Z   j   z |
  1486.   11 |VT  ESC| +   ;   K   [   k   { |
  1487.   12 |FF  FS | ,   <   L   \   l   | |
  1488.   13 |CR  GS | -   =   M   ]   m   } |
  1489.   14 |SO  RS | .   >   N   ^   n   ~ |
  1490.   15 |SI  US | /   ?   O   _   o  DEL|
  1491.      +---+---+---+---+---+---+---+---+
  1492.  
  1493.   Figure 1: The ASCII / ISO-646 International
  1494.      Reference Version 7-bit Character Set
  1495. _____________________________________________________________________________
  1496.  
  1497. Characters are often referred to by their column and row position in this type
  1498. of table.  For example, character 05/08 in Figure 1 is "X".  Columns 00-01,
  1499. plus character 07/15, comprise the control set.  Columns 02-07, minus
  1500. character 07/15, comprise the graphics.
  1501.  
  1502. ISO Standard 646 allows for national variant 7-bit character sets in which
  1503. certain non-alphanumeric ASCII graphic characters are replaced by "national
  1504. characters".  The character positions in which replacements are permitted,
  1505. along with the replacements used by four of the ten ISO 646 national variants,
  1506. are shown in Table B-1.
  1507.  
  1508. _____________________________________________________________________________
  1509.  
  1510. Column/Row   ASCII         German        Finnish      Norwegian    French
  1511.  
  1512.   04/00      at-sign       section       at-sign      at-sign      a-grave
  1513.   05/11      left-bracket  A-diaeresis   A-diaeresis  AE-digraph   degree
  1514.   05/12      backslash     O-diaeresis   O-diaeresis  O-slash      c-cedilla
  1515.   05/13      right-bracket U-diaeresis   A-circle     A-circle     section
  1516.   06/00      accent-grave  accent-grave  e-acute      accent-grave accent-grave
  1517.   07/11      left-brace    a-diaeresis   a-diaeresis  ae-digraph   e-acute
  1518.   07/12      vertical-bar  o-diaeresis   o-diaeresis  o-circle     u-grave
  1519.   07/13      right-brace   u-diaeresis   a-circle     a-circle     e-grave
  1520.   07/14      tilde         ess-zet       u-diaeresis  tilde        diaeresis
  1521.  
  1522.      Table B-1: Selected ISO 646 National Variants, Differences from ASCII
  1523. _____________________________________________________________________________
  1524.  
  1525. The ISO-registered 7-bit national sets are listed in Table B-2.
  1526. _____________________________________________________________________________
  1527.  
  1528.                                        ISO
  1529. Description                            Reg.#
  1530.  
  1531.   International Reference Version        2
  1532.   British Version, BSI 4730              4
  1533.   USA Version, ANSI X3.4-1986            6
  1534.   Swedish Version, SEN 850200/B         10
  1535.   Japanese Version, Roman Chars         14
  1536.   Italian Version                       15
  1537.   Spanish Version                       17
  1538.   German Version                        21
  1539.   Norwegian Version, NS 4551            60
  1540.   French Version, NF Z 62010            69
  1541.   Portuguese Version                    84
  1542.   Hungarian Version, HS 7795/3          86 
  1543.   Cuba National Standard NC 99-10:81   151
  1544.   Finnish (DEC Private)                 --
  1545.   French Canadian (DEC Private)         --
  1546.   Swiss (DEC Private)                   --
  1547.  
  1548.      Table B-2:  National 7-Bit Character Sets
  1549. _____________________________________________________________________________
  1550.  
  1551.  
  1552. 8-bit character sets are described in ISO 4873 and related standards (see
  1553. Appendix A).  An 8-bit character set has two sides.  Each side has a control
  1554. set and a graphics set.  The "left half" consists of the control set C0 and
  1555. the graphics set GL (Graphics Left).  GL has 94 characters, and corresponds to
  1556. ASCII (and ISO 646 IRV) positions 02/01-07/14.  SP (space) and DEL are
  1557. special: they are pieces of the template (the upper right and lower left
  1558. corners, respectively) into which any 94-byte graphic character set must fit.
  1559.  
  1560. All the characters in the left half (C0, GL, SP, and DEL) have their
  1561. high-order, or 8th, bit set to zero, and are therefore representable in 7
  1562. bits.  The "right half" consists of the control set C1 and the graphics set GR
  1563. (Graphics Right).  All characters in the right half have their 8th bits set to
  1564. one.  Figure 2 shows the layout of an 8-bit character set, with C1 occupied
  1565. by the ISO 6429 control character set.
  1566.  
  1567. _____________________________________________________________________________
  1568.  
  1569.      <--C0--> <---------GL---------->  <--C1--> <---------GR---------->
  1570.        00  01  02  03  04  05  06  07    08  09  10  11  12  13  14  15
  1571.      +---+---+---+---+---+---+---+---+ +---+---+---+---+---+---+---+---+
  1572.   00 |NUL DLE| SP  0   @   P   `   p | |    DCS|---+                   |
  1573.   01 |SOH DC1| !   1   A   Q   a   q | |    PU1|                       |
  1574.   02 |STX DC2| "   2   B   R   b   r | |    PU2|                       |
  1575.   03 |ETX DC3| #   3   C   S   c   s | |    STS|                       |
  1576.   04 |EOT DC4| $   4   D   T   d   t | |IND CCH|                       |
  1577.   05 |ENQ NAK| %   5   E   U   e   u | |NEL MW |                       |
  1578.   06 |ACK SYN| &   6   F   V   f   v | |SSA SPA|                       |
  1579.   07 |BEL ETB| '   7   G   W   g   w | |ESA EPA|                       |
  1580.   08 |BS  CAN| (   8   H   X   h   x | |HTS    |      (special         |
  1581.   09 |HT  EM | )   9   I   Y   i   y | |HTJ    |       graphics)       |
  1582.   10 |LF  SUB| *   :   J   Z   j   z | |VTS    |                       |
  1583.   11 |VT  ESC| +   ;   K   [   k   { | |PLD CSI|                       |
  1584.   12 |LF  FS | ,   <   L   \   l   | | |PLU ST |                       |
  1585.   13 |CR  GS | -   =   M   ]   m   } | |RI  OSC|                       |
  1586.   14 |SO  RS | .   >   N   ^   n   ~ | |SS2 PM |                       |
  1587.   15 |SI  US | /   ?   O   _   o  DEL| |SS3 APC|                   +---|
  1588.      +---+---+---+---+---+---+---+---+ +---+---+---+---+---+---+---+---+
  1589.      <--C0--> <---------GL---------->  <--C1--> <---------GR---------->
  1590.  
  1591.                       Figure 2: An 8-Bit Character Set
  1592. _____________________________________________________________________________
  1593.  
  1594. GR character sets can have either 94 or 96 characters.  A 94-character GR set
  1595. begins in position 10/01 and ends in position 15/14, with Space (SP) occupying
  1596. position 10/00 and DEL in position 15/15, just like GL (the corners shown in
  1597. GR in the diagram).  A 96-character set has graphic characters in all 96
  1598. positions, 10/00 through 15/15.
  1599.  
  1600. An 8-bit alphabet, therefore, has up to 94 + 96 = 190 graphic characters.
  1601. This number is sufficient to represent the characters in many of the world's
  1602. written languages, but not necessarily sufficient to represent all the graphic
  1603. symbols required in a given application, for instance a multi-language
  1604. document.
  1605.  
  1606. To represent a greater number of graphic characters, ISO 4873 defines four
  1607. "intermediate sets" of graphic characters, of either 94 or 96 characters each.
  1608. These are called G0, G1, G2, and G3.  The G0 set never has more than 94
  1609. graphic characters, and G1-G3 can have up to 96 each.  Therefore there can be
  1610. up to:
  1611.  
  1612.   94 + (3 x 96) = 382
  1613.  
  1614. graphics characters simultaneously within the repertoire of a given device.
  1615.  
  1616. These intermediate graphics sets are kept in tables in the memory of the
  1617. terminal or computer.  One of the intermediate sets (usually G0) is assigned
  1618. to GL, and (in the 8-bit communications environment) another may be assigned
  1619. to GR.  When the terminal or computer receives a data byte, the numeric value
  1620. of its bits denotes the position of the character in GL or GR.  For example,
  1621. the byte 01000001 binary = 65 decimal = 04/01 = uppercase A in ASCII.  In the
  1622. 8-bit environment, any byte with its 8th bit set to zero is from GL, and a
  1623. byte with its 8th bit set to one is from GR.
  1624.  
  1625. A language like English can be represented adequately by ASCII in GL, because
  1626. all the required characters fit there.  When a language has more than 94
  1627. characters, two techniques are used to represent all the characters:
  1628.  
  1629.   1. For alphabetic languages, put ASCII (or the ISO-646 IRV) in GL and
  1630.      the special characters (like accented letters) in GR.  French, German,
  1631.      and Russian are examples.
  1632.  
  1633.   2. For languages with many symbols (e.g. where a symbol is assigned
  1634.      to each word, rather than to each sound), represent each character
  1635.      with multiple bytes rather than one byte.  Japanese Kanji, for example,
  1636.      uses a 2-byte code.  A multibyte code may be assigned to G0, G1, G2, or
  1637.      G3, just like a single-byte code.
  1638.  
  1639. How do we assign actual character sets to G0-G3, and how do we associate the
  1640. intermediate character sets with the active character set?
  1641.  
  1642. Selection of character sets is accomplished using special control characters
  1643. and escape sequences embedded within the data stream as described in ISO
  1644. Standard 2022.  An ESCAPE SEQUENCE is used to DESIGNATE a particular alphabet
  1645. (such as Roman, Cyrillic, Hebrew, Arabic, Kanji, etc) to a particular
  1646. intermediate graphics set (G0, G1, G2, or G3).  A SHIFT FUNCTION is used to
  1647. INVOKE a particular intermediate graphics set into GL or GR.  In programmer's
  1648. terms, GL and GR are pointers into the array of tables G0..G3, and the shift
  1649. functions simply change the values of these pointers.
  1650.  
  1651. In our discussion, we use the following notation (numbers are decimal unless
  1652. otherwise noted):
  1653.  
  1654.   <ESC> Escape (ASCII 27, character 01/11)
  1655.   <SP>  Space  (ASCII 32, character 02/00)
  1656.   <SO>  Shift Out (Ctrl-N, ASCII 14, character 00/14)
  1657.   <SI>  Shift In  (Ctrl-O, ASCII 15, character 00/15)
  1658.  
  1659. Table 5 shows the alphabet designation functions for single-byte and
  1660. multi-byte character sets in both the 7-bit and 8-bit environments.  The
  1661. character which is substituted for "F" identifies the actual character set to
  1662. be used.
  1663.  
  1664. _____________________________________________________________________________
  1665.  
  1666.   Escape
  1667.  Sequence     Function                                         Invoked By
  1668.  
  1669.   <ESC>(F     assigns 94-character graphics set "F" to G0.     SI or LS0
  1670.   <ESC>)F     assigns 94-character graphics set "F" to G1.     SO or LS1
  1671.   <ESC>*F     assigns 94-character graphics set "F" to G2.     SS2 or LS2
  1672.   <ESC>+F     assigns 94-character graphics set "F" to G3.     SS3 or LS3
  1673.   <ESC>-F     assigns 96-character graphics set "F" to G1.     SO or LS1
  1674.   <ESC>.F     assigns 96-character graphics set "F" to G2.     SS2 or LS2
  1675.   <ESC>/F     assigns 96-character graphics set "F" to G3.     SS3 or LS3
  1676.   <ESC>$(F    assigns multibyte character set "F" to G0.       SI or LS0
  1677.   <ESC>$)F    assigns multibyte character set "F" to G1.       SO or LS1
  1678.   <ESC>$*F    assigns multibyte character set "F" to G2.       SS2 or LS2
  1679.   <ESC>$+F    assigns multibyte character set "F" to G3.       SS3 or LS3
  1680.  
  1681.              Table 5: Escape Sequences for Alphabet Designation
  1682. _____________________________________________________________________________
  1683.  
  1684.  
  1685. Table 6 shows the escape sequences used to designate the appropriate parts of
  1686. each of the registered character sets discussed in this proposal to G1 (except
  1687. that ASCII is designated to G0, which is the normal situation).  It is
  1688. important to note that the final letter of the escape sequence is not always
  1689. sufficient to designate a character set.  For example, Czech Standard and JIS
  1690. Katakana are both designated by letter I, but the two can be distinguished by
  1691. the intermediate characters of the escape sequence, which specify whether the
  1692. set is single- or multibyte, or, when both sets are single-byte, whether there
  1693. are 94 or 96 characters.
  1694.  
  1695. _____________________________________________________________________________
  1696.  
  1697.                             Escape    ISO          ECMA        ISO/ECMA
  1698.  Alphabet Name              Sequence  Reference    Reference   Registration
  1699.  
  1700.   ASCII (ANSI X3.4-1986)    <ESC>(B   ISO 646 IRV  ECMA-6        6
  1701.   Latin Alphabet No. 1      <ESC>-A   ISO 8859-1   ECMA-94     100
  1702.   Latin Alphabet No. 2      <ESC>-B   ISO 8859-2   ECMA-94     101
  1703.   Latin Alphabet No. 3      <ESC>-C   ISO 8859-3   ECMA-94     109
  1704.   Latin Alphabet No. 4      <ESC>-D   ISO 8859-4   ECMA-94     110
  1705.   Latin/Cyrillic            <ESC>-L   ISO 8859-5   ECMA-113    144
  1706.   Latin/Arabic              <ESC>-G   ISO 8859-6   ECMA-114    127
  1707.   Latin/Greek               <ESC>-F   ISO 8859-7   ECMA-118    126
  1708.   Latin/Hebrew              <ESC>-H   ISO 8859-8   ECMA-121    138
  1709.   Latin Alphabet No. 5      <ESC>-M   ISO 8859-9   ECMA-128    148
  1710. * Math/Technical Set        <ESC>-K   ????         ????        143
  1711.   Chinese (CAS GB 2312-80)  <ESC>$)A  none         none         58
  1712.   Japanese (JIS X 0208)     <ESC>$)B  none         none         87
  1713.   JIS-Katakana (JIS X 0201) <ESC>)I   none         none         13
  1714.   JIS-Roman (JIS X 0201)    <ESC>)J   none         none         14
  1715.   Korean (KS C 5601-1987)   <ESC>$)C  none         none        149
  1716.  
  1717.    Table 6: Alphabets, Selectors, Standards, and Registration Numbers
  1718. _____________________________________________________________________________
  1719.  
  1720. * A math/technical set is clearly needed to handle the IBM PC, DEC VT-series,
  1721.   and other math/technical/line-drawing characters, but there is apparently
  1722.   no such standard set at this time (ISO 6862? ISO DIS 10367?)
  1723.  
  1724. Tables 7 and 8 show the shift functions that are used to invoke the
  1725. intermediate character sets.  These shift functions may be either locking or
  1726. single.  "Locking shift" is like shift-lock on a typewriter.  It means that
  1727. all subsequent characters until the next shift are to be taken from the
  1728. designated intermediate character set.  "Single shift" applies only to the
  1729. character (either single or multibyte) that follows it immediately, but single
  1730. shift functions are only available for the G2 and G3 sets.  Locking shift
  1731. functions remain in effect across alphabet changes.
  1732.  
  1733. In the 7-bit environment, only one character set, GL, can be active at a time.
  1734. The active character set can be selected from among the intermediate sets
  1735. G0-G3 by the shifts shown in Table 6.  Control characters from C0 are
  1736. transmitted as-is, and those from the C1 set are sent prefixed by <ESC>
  1737. followed by the character value, minus 64.  For example, the C1 character
  1738. 10000001 binary (129 decimal) becomes <ESC>A (129 - 64 = 65 = "A").
  1739.  
  1740. _____________________________________________________________________________
  1741.  
  1742.  Shift  Representation  Name              Function
  1743.  
  1744.   SI       Ctrl-O       Shift In          invoke G0 into GL
  1745.   SO       Ctrl-N       Shift Out         invoke G1 into GL
  1746.   LS2      <ESC>n       Locking Shift 2   invoke G2 into GL
  1747.   LS3      <ESC>o       Locking Shift 3   invoke G3 into GL
  1748.   SS2      <ESC>N       Single Shift 2    select single character from G2
  1749.   SS3      <ESC>O       Single Shift 3    select single character from G3
  1750.  
  1751.                Table 7: Shifts Used in the 7-Bit Environment
  1752. _____________________________________________________________________________
  1753.  
  1754. In the 8-bit environment two character sets, GL and GR, can be active at once.
  1755. A GL character is selected by a byte whose 8th bit is zero, and a GR character
  1756. by a byte whose eighth bit is one.  The actual character sets assigned to GL
  1757. and GR are selected by the shifts shown in Table 8.  Control characters from
  1758. both the C0 and C1 sets are sent as is.
  1759.  
  1760. _____________________________________________________________________________
  1761.  
  1762.  Shift  Representation  Name                   Function
  1763.  
  1764.   LS0      Ctrl-O       Locking Shift 0        invoke G0 into GL
  1765.   LS1      Ctrl-N       Locking Shift 1        invoke G1 into GL
  1766.   LS2      <ESC>n       Locking Shift 2        invoke G2 into GL
  1767.   LS3      <ESC>o       Locking Shift 3        invoke G3 into GL
  1768.   LS1R     <ESC>~       Locking Shift 1 Right  invoke G1 into GR
  1769.   LS2R     <ESC>}       Locking Shift 2 Right  invoke G2 into GR
  1770.   LS3R     <ESC>|       Locking Shift 3 Right  invoke G3 into GR
  1771.   SS2       08/14       Single Shift 2         select single character from G2
  1772.   SS3       08/15       Single Shift 3         select single character from G3
  1773.  
  1774.              Table 8: Shifts Used in the 8-Bit Environment
  1775. _____________________________________________________________________________
  1776.  
  1777. So we have a 3-tiered system.  At the bottom tier lie all the world's coded
  1778. character sets.  We can designate up to four of them, one to each of the
  1779. intermediate graphics sets G0, G1, G2, and G3 using the escape sequences shown
  1780. in Tables 5 and 6.  The terminal or computer keeps each of the selected
  1781. intermediate sets in memory.  There is also one active set, composed of GL and
  1782. GR.  The intermediate sets are invoked to GL or GR (one at a time) by the
  1783. shifts SO, SI, LS0, LS1, etc, shown in Tables 7 and 8.  A simplified diagram
  1784. for the 8-bit environment is shown in Figure 3 (see ISO 2022 for detailed
  1785. diagrams of both the 7-bit and 8-bit environments).  On a more sophisticated
  1786. output device, Figure 3 would contain numerous arrows pointing upwards to
  1787. demonstrate the operation of the designators and shifts.
  1788.  
  1789. _____________________________________________________________________________
  1790.  
  1791.                    +--+--------+  +--+--------+
  1792.                    |C0|   GL   |  |C1|   GR   |
  1793.                    |  |        |  |  |        |                  8-Bit
  1794.                    |  |        |  |  |        |                  Code
  1795.                    |  |        |  |  |        |                  In Use
  1796.                    +--+--------+  +--+--------+
  1797.  
  1798.  
  1799.          LS0          LS1,LS1R      LS2,LS2R      LS3,LS3R       Shifts
  1800.                                       SS2           SS3
  1801.        +--------+    +--------+    +--------+    +--------+      Intermediate
  1802.        |        |    |        |    |        |    |        |      Graphics
  1803.        |   G0   |    |   G1   |    |   G2   |    |   G3   |      Sets
  1804.        |        |    |        |    |        |    |        |
  1805.        +--------+    +--------+    +--------+    +--------+
  1806.                                                                  Alphabet
  1807.                                                                  Designation
  1808.  <ESC>(B      <ESC>-A      <ESC>-B      <ESC>-L      <ESC>$)B    Sequences
  1809.                                                     +---------+
  1810. +--------+   +--------+   +--------+   +--------+  +--------+ |  The world's
  1811. | ISO    |   | ISO    |   |  ISO   |   |  ISO   |  | JIS X  | |  registered
  1812. | 646IRV |   | Latin  |   |  Latin |   |  Latin |  | 0208   | |  character
  1813. |(ASCII) |   | 1      |   |  2     |   |Cyrillic|  | Kanji  | +  sets
  1814. +--------+   +--------+   +--------+   +--------+  +--------+
  1815.  
  1816.           Figure 3: The ISO 2022 Character Set Selection Mechanisms
  1817. _____________________________________________________________________________
  1818.  
  1819. For example, the following sequence could be used to transmit the German word
  1820. "<u-diaeresis>bern<a-diaeresis>chtig" using Latin Alphabet 1 in the 7-bit
  1821. environment:
  1822.  
  1823.   <ESC>(B<ESC>-A<SO>|<SI>bern<SO>d<SI>chtig
  1824.  
  1825. where:
  1826.  
  1827.   <ESC>(B   designates ASCII to G0
  1828.   <ESC>-A   designates the right half of Latin Alphabet 1 to G1
  1829.   <SO>      invokes G1 to GL
  1830.   |         is character 07/12, but since G1 is invoked to GL, it really
  1831.               denotes character 15/12, which is <u-diaeresis>
  1832.   <SI>      invokes G0 to GL
  1833.   bern      are characters from G0, which is invoked in GL
  1834.   <SO>      invokes G1 to GL
  1835.   d         is character 06/04, but since G1 is invoked to GL, it really
  1836.               denotes character 14/04, which is <a-diaeresis>
  1837.   <SI>      invokes G0 to GL
  1838.   chtig     are characters from G0
  1839.  
  1840. The same word could be transmitted in the 7-bit environment using single
  1841. shifts, if Latin Alphabet 1 were designated to G2 (or G3):
  1842.  
  1843.   <ESC>(B<ESC>*A<ESC>N|bern<ESC>Ndchtig
  1844.  
  1845. (where <ESC>*A designates Latin-1 to G2, and <ESC>N is Single Shift 2).
  1846.  
  1847. In the 8-bit environment it could be transmitted using no shifts at all:
  1848.  
  1849.   <ESC>(B<ESC>-A<u-diaeresis>bern<a-diaeresis>chtig
  1850.  
  1851. The designation escape sequences are transmitted only at the beginning of a
  1852. session and need not be repeated after the initial designations are made,
  1853. unless an intermediate set (G0-G3) is to be recycled.
  1854.  
  1855. To understand the three-tiered design of ISO 2022, imagine a computer
  1856. programmed to display a mixture of character sets on its screen.  A large
  1857. collection of fonts might be stored on the disk, one font per file.  These are
  1858. the character sets of the bottom tier.  When a font is needed, it will be read
  1859. from the disk and stored in memory in an array, for rapid access.  If several
  1860. fonts are needed, they will be stored in several arrays.  These arrays are the
  1861. intermediate character sets, G0-G3.  When a data byte arrives to be displayed,
  1862. the actual graphic representation is taken from GL or GR (depending on the
  1863. byte's 8th bit).  GL is associated with one of the intermediate graphic sets,
  1864. and GR with another.  If no more than four character sets are used, then each
  1865. one needs to be read from the disk only once, and display is rapid and
  1866. efficient thereafter.
  1867.  
  1868. Perhaps the most common application of ISO 2022 shifting techniques is with
  1869. the Japanese EUC (Extended UNIX Code) character set, which combines JIS X
  1870. 0201 (which in turn consists of an ASCII-like Roman alphabet in the left half
  1871. and Japanese Katakana characters in the right) and JIS X 0208 (a double-byte
  1872. Japanese Kanji character set).  EUC encoding is used not only in data
  1873. communications, but also in files, e-mail, etc.  EUC is used as follows:
  1874.  
  1875.   Left half of JIS X 0201 (Roman, similar to ASCII) is designated to G0.
  1876.   JIS X 0208 (Kanji) is designated to G1.
  1877.   Right half of JIS X 0201 (Katakana) is designated to G2.
  1878.   G0 is initially invoked to GL.
  1879.   G1 is initially invoked to GR.
  1880.  
  1881. In the 8-bit environment, any byte with its 8th bit equal to zero is a Roman
  1882. G0 graphic or a C0 control character.  A byte with its 8th bit equal to 1 and
  1883. low-order 7 bits falling in the graphic range is the first byte of a Kanji
  1884. character pair.  Others are C1 controls.  The C1 control character SS2
  1885. selects the subsequent single byte from the Katakana set.
  1886.  
  1887. In the 7-bit environment, SO and SI are used to shift G1 in and out of GL,
  1888. and Kanji bytes are transmitted without their high-order bits.  C1 controls,
  1889. including SS3, are transmitted in their 2-byte 7-bit form (SS2 becomes
  1890. <ESC>N).
  1891.  
  1892.  
  1893. ANNOUNCING ISO 2022 FACILITIES
  1894.  
  1895. A large portion of ISO 2022 is devoted to describing how 8-bit characters may
  1896. be transmitted on a 7-bit communication path, for example when parity is in
  1897. use.  In the 7-bit environment, there is only GL -- no GR.  Therefore, all
  1898. characters are transmitted with their 8th bit removed, and shifts are used to
  1899. specify which intermediate set they belong to.
  1900.  
  1901. In fact, there are many possible ways to use the ISO 2022 code extension
  1902. facilities within both 7-bit and 8-bit environments.  For example, the sender
  1903. may inform the receiver in advance whether G1, G2, or G3 will be used, etc, so
  1904. that the receiver can allocate the appropriate resources.  At the beginning of
  1905. any particular data transfer, the facilities that actually will be used can be
  1906. announced with a sequence of the form <ESC><SP>F, where F is replaced by an
  1907. ISO 2022 announcer.  Several of the most important ones are described here.
  1908. Table 9 lists all the defined announcers in summary form.  For details, see
  1909. ISO 2022.
  1910.  
  1911. <ESC><SP>A means that only the G0 set will be used, invoked into GL.  No
  1912.   shift functions will be used.  In the 8-bit environment, GR is not used.
  1913.   In other words, only a single 7-bit character set is used.
  1914.  
  1915. <ESC><SP>B means the G0 and G1 sets will be used with locking shifts.  In the
  1916.   7-bit environment <SI> invokes G0 into GL, <SO> invokes G1 into GL.  In the
  1917.   8-bit environment, LS0 invokes G0 into GL, LS1 invokes G1 into GL.  In other
  1918.   words, two character sets are used, with characters from both sets always
  1919.   sent as 7-bit values, with locking shifts used to specify the 8th bit.
  1920.  
  1921. <ESC><SP>C means that G0 and G1 will be used in the 8-bit environment, with G0
  1922.   invoked in GL and G1 in GR.  No locking shift functions are used.  In other
  1923.   words, a single 8-bit character set is used, with all 8 bits transmitted as
  1924.   data.  GL is selected when the character's 8th bit is zero, GR is selected
  1925.   when the 8th bit is one.
  1926.  
  1927. <ESC><SP>D means that G0 and G1 will be used with locking shifts.  In the
  1928.   7-bit environment, <SI> invokes G0 into GL and <SO> invokes G1 into GL.  In
  1929.   the 8-bit environment, all 8 bits of each character are transmitted with no
  1930.   shifts.
  1931.  
  1932. <ESC><SP>L means that Level 1 of ISO 4873 will be used.  That is, a single
  1933.   8-bit character set with C0, G0, C1, and G1, with no shift functions.
  1934.   This is like <ESC><SP>C.
  1935.  
  1936. <ESC><SP>M means that Level 2 of ISO 4873 will be used.  This is equivalent
  1937.   to Level 1, with the addition of G2 and G3.  Characters from G2 and G3 are
  1938.   invoked only by the single-shift functions SS2 and SS3.
  1939.  
  1940. <ESC><SP>N means that Level 3 of ISO 4873 will be used.  This is equivalent
  1941.   to Level 2 with the addition of the locking shift functions LS1R, LS2R, and
  1942.   LS3R. (Note that ISO 4873 does not concern itself with the 7-bit
  1943.   environment, and therefore does not discuss the use of LS0, LS1, LS2, or
  1944.   LS3.)
  1945.  
  1946. _____________________________________________________________________________
  1947.  
  1948. Esc Sequence  7-Bit Environment          8-Bit Environment
  1949.  
  1950. <ESC><SP>A    G0->GL                     G0->GL
  1951. <ESC><SP>B    G0-(SI)->GL, G1-(SO)->GL   G0-(LS0)->GL, G1-(LS1)->GL
  1952. <ESC><SP>C    (not used)                 G0->GL, G1->GR
  1953. <ESC><SP>D    G0-(SI)->GL, G1-(SO)->GL   G0->GL, G1->GR
  1954. <ESC><SP>E    Full preservation of shift functions in 7 & 8 bit environments
  1955. <ESC><SP>F    C1 represented as <ESC>F   C1 represented as <ESC>F
  1956. <ESC><SP>G    C1 represented as <ESC>F   C1 represented as 8-bit quantity
  1957. <ESC><SP>H    All graphic character sets have 94 characters
  1958. <ESC><SP>I    All graphic character sets have 94 or 96 characters
  1959. <ESC><SP>J    In a 7 or 8 bit environment, a 7 bit code is used
  1960. <ESC><SP>K    In an 8 bit environment, an 8 bit code is used
  1961. <ESC><SP>L    Level 1 of ISO 4873 is used
  1962. <ESC><SP>M    Level 2 of ISO 4873 is used
  1963. <ESC><SP>N    Level 3 of ISO 4873 is used
  1964. <ESC><SP>P    G0 is used in addition to any other sets:
  1965.               G0 -(SI)-> GL              G0 -(LS0)-> GL
  1966. <ESC><SP>R    G1 is used in addition to any other sets:
  1967.               G1 -(SO)-> GL              G1 -(LS1)-> GL
  1968. <ESC><SP>S    G1 is used in addition to any other sets:
  1969.               G1 -(SO)-> GL              G1 -(LS1R)-> GR
  1970. <ESC><SP>T    G2 is used in addition to any other sets:
  1971.               G2 -(LS2)-> GL             G2 -(LS2)-> GL
  1972. <ESC><SP>U    G2 is used in addition to any other sets:
  1973.               G2 -(LS2)-> GL             G2 -(LS2R)-> GR
  1974. <ESC><SP>V    G3 is used in addition to any other sets:
  1975.               G3 -(LS2)-> GL             G3 -(LS3)-> GL
  1976. <ESC><SP>W    G3 is used in addition to any other sets:
  1977.               G3 -(LS2)-> GL             G3 -(LS3R)-> GR
  1978. <ESC><SP>Z    G2 is used in addition to any other sets:
  1979.               SS2 invokes a single character from G2
  1980. <ESC><SP>[    G3 is used in addition to any other sets:
  1981.               SS3 invokes a single character from G3
  1982.  
  1983.                      Table 9: ISO 2022 Announcer Summary
  1984. _____________________________________________________________________________
  1985.  
  1986.  
  1987. STANDARD VERSUS PRIVATE CHARACTER SETS
  1988.  
  1989. Most of the popular private 8-bit character sets, notably the IBM PC code
  1990. pages and the Apple Macintosh character sets (but they are not alone), differ
  1991. from the standard character sets in three important ways:
  1992.  
  1993.  1. The repertoire of characters is different.
  1994.  2. The encoding of characters is different.
  1995.  3. The C1 area is sometimes used for graphics, which is forbidden by the
  1996.     standards. 
  1997.  4. In some cases, even the C0 area is used for graphics.
  1998.  
  1999. However, most of these character sets conform to the requirement that the
  2000. left half be identical with US ASCII.
  2001.  
  2002.  
  2003. APPENDIX C:  (deleted)
  2004.  
  2005.  
  2006. APPENDIX D: SUMMARY OF KERMIT COMMANDS RELATED TO CHARACTER SET TRANSLATION
  2007.  
  2008.  
  2009. SET FILE TYPE { BINARY, TEXT }
  2010.  
  2011.     BINARY means no translation, and overrides all other file-related
  2012.     commands, including SET TRANSFER.
  2013.  
  2014.     TEXT is the default.  Enables file transfer character set translation,
  2015.     depending on the setting of SET TRANSFER.
  2016.  
  2017. SET FILE CHARACTER-SET <name>
  2018.  
  2019.     Effective only when file type is TEXT.
  2020.     Tell Kermit what character set the file is coded in,
  2021.     or what character set to translate an incoming file to.
  2022.  
  2023. SET TRANSFER { CHARACTER-SET <name>, LOCKING-SHIFT { ON, OFF, FORCED } }
  2024.  
  2025.     CHARACTER-SET <name>
  2026.       Invoke file transfer character set translation.  <name> is
  2027.       TRANSPARENT, ASCII, LATIN1, LATIN2, ..., CYRILLIC, JAPAN-EUC, etc.
  2028.  
  2029.     LOCKING-SHIFT { ON, OFF, FORCED }
  2030.       Enable, disable, or force locking-shift transport protocol for
  2031.       efficient transfer of 8-bit data in the 7-bit communications
  2032.       environment.  Normally enabled.  Used only if both Kermit programs
  2033.       agree in the feature negotiation phase to use it (essentially, if
  2034.       PARITY is not NONE, and they both have locking-shift capability).
  2035.  
  2036. SET LANGUAGE <name>
  2037.  
  2038.     This command informs the program which language is being translated,
  2039.     to allow for special language-based transliteration rules, such as
  2040.     replacing a-diaeresis by ae.
  2041.  
  2042. SET { TRANSFER, TERMINAL } TRANSLATION { INVERTIBLE, READABLE }
  2043.  
  2044.     Specify the goal of the specified translation: invertibility or
  2045.     readability.
  2046.  
  2047. SET UNKNOWN-CHARACTER-SET { KEEP, CANCEL }
  2048.  
  2049.     Tell the file receiver whether to keep or cancel an incoming file that
  2050.     contains an unknown character set.  KEEP is the default.
  2051.  
  2052. SET { SEND, RECEIVE } AUTOMATIC-TRANSLATION { ON, OFF, <set1> [ <set2> ] }
  2053.  
  2054.     Enable or disable automatic selection of a file transfer 
  2055.     translation table in the indicated direction, or specify pairs
  2056.     character sets to be used: given <set1>, automatically translate to
  2057.     <set2>.  Default in both directions is OFF.
  2058.  
  2059. SET ATTRIBUTES { ON, OFF }
  2060. SET ATTRIBUTE <name-of-attribute> { ON, OFF }
  2061.  
  2062.     Enables or disables processing of attribute packets, or specific
  2063.     attribute fields such as DATE, ENCODING, LENGTH, etc.
  2064.  
  2065. SET TERMINAL { CHARACTER-SET, DIRECTION, LOCKING-SHIFT, TRANSLATION }
  2066.  
  2067.     Specifies terminal emulation character-set translation, screen writing
  2068.     direction, locking shift usage, translation goal.
  2069.  
  2070. SHOW { CHARACTER-SETS, LANGUAGE, FILE, TRANSFER, PROTOCOL, TERMINAL }
  2071.  
  2072.     Display what character sets, translation tables, and languages are
  2073.     available, and which ones are currently selected.
  2074.  
  2075. TRANSLATE <file1> <file2> [ <file1-character-set> [ <file2-character-set> ] ]
  2076.  
  2077.     Copies local file <file1> to local file <file2>, translating <file1> from
  2078.     <file1-character-set> to <file2-character-set>.  If <file1-character-set>
  2079.     is not specified, the current FILE CHARACTER-SET is used.  If
  2080.     <file2-character-set> is not specified, the current TRANSFER CHARACTER-SET
  2081.     is used.  Note that this command can be used to convert between two
  2082.     different FILE CHARACTER-SETS, in which case an appropriate TRANSFER
  2083.     CHARACTER-SET can be used in an intermediate step.
  2084.  
  2085.  
  2086. APPENDIX E:  (Deleted)
  2087.  
  2088.  
  2089. APPENDIX F:  (Deleted)
  2090.  
  2091.  
  2092. APPENDIX G:  OFFICIAL CHARACTER SET TRANSLATIONS
  2093.  
  2094. Apple: ???
  2095.  
  2096. Atari: ???
  2097.  
  2098. IBM: Reportedly, IBM lists the translations between its corporate code pages
  2099. and ISO standard character sets in the following manuals:
  2100.  
  2101.   "SAA Character Data Representation Architecture (CDRA)"
  2102.     Executive Overview: GC09-1392
  2103.     Reference: SC09-1390
  2104.     Level-1, Registry: SC09-1391 (tables)
  2105.  
  2106. Commodore: ???
  2107.  
  2108. Data General: ???
  2109.  
  2110. Digital Equipment Corporation: ???
  2111.  
  2112. Microsoft: ???
  2113.  
  2114. (Much work is needed on this section...)
  2115.  
  2116.  
  2117. REFERENCES:
  2118.  
  2119. The standards listed in Appendix A, the documents in Appendix G, plus:
  2120.  
  2121. CCITT Recommendation T.61, "Character Repertoire and Coded Character Sets for
  2122. the International Teletex Service", Geneva (1980, amended at
  2123. Malaga-Torremolinos 1984).
  2124.  
  2125. Chandler, John, "IBM System/370 Kermit User's Guide", version 4.2, (1991)
  2126. (Internet: watsun.cc.columbia.edu:kermit/b/ik[cmtx]ker.{doc,ps}).  For VM/CMS,
  2127. MVS/TSO, CICS, and MUSIC.  Detailed description of how to use Kermit's
  2128. character set translation facilities in the IBM mainframe environment.
  2129.  
  2130. da Cruz, Frank, "Kermit, A File Transfer Protocol", Digital Press (1987).
  2131. The specification of the Kermit file transfer protocol before the addition
  2132. of this extension.
  2133.  
  2134. Gianone, Christine M., "It's Time to Prepare for International Computing",
  2135. PC Week, October 2, 1989.
  2136.  
  2137. Gianone, Christine M., "Using MS-DOS Kermit", Second Edition, Digital Press
  2138. (1991).  Chapter 13 describes how to use the character set translation
  2139. facilities of MS-DOS Kermit 3.0 and later on IBM PCs, PS/2s, and compatibles,
  2140. for both terminal emulation and file transfer.  Also included are character
  2141. set and conversion tables for many Roman and Cyrillic character sets.
  2142.  
  2143. Gianone, Christine M., and Frank da Cruz, "C-Kermit User Guide", version 5A
  2144. (1991) (Internet: watsun.cc.columbia.edu:kermit/sw/ckuker.{doc,ps}).
  2145. Description of the terminal and file transfer character set translation
  2146. features of C-Kermit 5A for UNIX and VAX/VMS.
  2147.  
  2148. Gianone, Christine M., and Frank da Cruz, "A Locking Shift Mechanism for the
  2149. Kermit File Transfer Protocol", unpublished paper, Columbia University,
  2150. October 1991 (watsun.cc.columbia.edu:kermit/e/lshift.txt).  A Kermit protocol
  2151. extension for transferring 8-bit text efficiently in the 7-bit communication
  2152. environment.
  2153.  
  2154. Hart, Edwin (ed.), "ASCII and EBCDIC Character Set and Code Issues in a
  2155. Systems Applications Architecture", SSD #366, SHARE Inc., Chicago, IL, USA
  2156. (June 1989).  Commonly called the "SHARE White Paper".  A cogent description
  2157. of the problems of character set translation in the IBM computing environment,
  2158. with recommendations adopted by SHARE, an international, voluntary
  2159. organization of users of IBM systems.
  2160.  
  2161. IBM System/370 Reference Summary, IBM GX20-1850-6.  The definitive US-ASCII /
  2162. US-EBCDIC translation table.
  2163.  
  2164. ISO 639, "Code for Representation of Names of Languages" (1988).  Useful for
  2165. naming language-related symbols in Kermit programs.
  2166.  
  2167. ISO 3166, "Country Codes" (1988 + Registration Newsletter updates).  Useful
  2168. for naming country-related symbols in Kermit programs.
  2169.  
  2170. ISO DIS2 10646 (in preparation), ISO Draft International Standard, Draft
  2171. Number 2, Multiple-Octet Coded Character Set.  The forthcoming universal
  2172. character set.
  2173.  
  2174. Pirard, Andr'e, "Guidelines to Use 8-Bit Character Codes", University of
  2175. Liege, Belgium, unpublished paper on character set translation problems,
  2176. written from the West European perspective, listing numerous suggested
  2177. invertible translation tables (watsun.cc.columbia.edu:kermit/e/pirard.txt).
  2178.  
  2179. "The Unicode Standard, Worldwide Character Encoding", Version 1.0, Volume 1,
  2180. Addison-Wesley (1991).
  2181.  
  2182. [End of ISOK6.TXT]
  2183.