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

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