home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / protocol / accents.txt < prev    next >
Text File  |  2020-01-01  |  64KB  |  1,194 lines

  1.                    INTERCHANGE OF NON-ENGLISH COMPUTER TEXT
  2.  
  3.                                  Frank da Cruz
  4.  
  5.                          Columbia University, New York
  6.                                      1994
  7.  
  8.                    (PLAIN-TEXT VERSION, LATIN-1 ENCODING)
  9.  
  10.  
  11. INTRODUCTION
  12.  
  13. Thirty years ago, computers and people communicated using a small
  14. repertoire of symbols, digits, and Roman letters.  Often the letters were
  15. only in uppercase, and there were no accents.  The language of computing
  16. was exclusively English.  Today, we are poised on the brink of a worldwide
  17. computer-based communications revolution, with a single character set
  18. encompassing all the world's writing systems.
  19.  
  20.    In the intervening decades, we have contrived a vast Babel of mutually
  21. incomprehensible character sets, both proprietary and standard.  The new
  22. Universal Character Set, ISO 10646 [19], offers a single common encoding for
  23. all writing systems.  But radical and massive changes are required in data
  24. entry and display hardware as well as in computer software and data files at
  25. all levels from operating system to application, and could therefore take
  26. decades to see widespread use.  In the meantime, how shall we survive our
  27. Babel?
  28.  
  29.    The problem is immediately apparent to anyone who tries to transfer
  30. non-English textual data between two different kinds of computers using
  31. conventional methods.  "PΓtΘ" on an IBM PC becomes "PEta" on the Macintosh,
  32. and a truckload of pocket-bread is delivered instead of goose liver.
  33.  
  34.    This paper presents a simplified and condensed description of the
  35. character-set translation method developed for the Kermit file transfer
  36. protocol.  The lessons learned should be useful in any arena where text must
  37. be transmitted meaningfully between unlike computer systems.  Familiarity with
  38. the standards process in general, and the US ASCII [1], ISO 646 [14], and ISO
  39. 8859 [18] character set standards is assumed, and with ISO Standards 2022 [15]
  40. and 4873 [17], as well as with proprietary character sets such as IBM PC code
  41. pages.
  42.  
  43.  
  44. TYPES OF CHARACTER SETS
  45.  
  46. Today's coded character sets can be classified along several axes: standard
  47. versus proprietary, 7-bit versus 8-bit, single-byte versus multibyte, and so
  48. on.  This paper treats only the character sets used in application-independent
  49. plain-text files, and not the application-specific text representations used in
  50. word processing, publishing, and similar environments that are concerned with
  51. rendering forms such as fonts, style, point size, ligatures, and so forth, and
  52. which sometimes offer character repertoires different from any plain-text
  53. character set.
  54.  
  55. Standard Character Sets
  56.  
  57. Let us define a standard character set as one that is registered in the ISO
  58. Register of Coded Characters to Be Used with Escape Sequences [21] under the
  59. provisions of ISO Standard 2375 [16].  The Register, which is maintained by
  60. the European Computer Manufacturers Association (ECMA), includes listings of
  61. all ISO-registered character sets and assigns unique registration numbers and
  62. designating escape sequences to each one.
  63.  
  64.    Standard character sets are subdivided into two major types: graphic and
  65. control.  Thus ASCII, which is the USA version of ISO 646, and which most
  66. people think of as a single character set, is really two sets: the ISO 646
  67. 32-character control set (ISO registration number 001) and a 94-character
  68. graphics set (ISO registration 006).  And, as specified by ISO Standard 4873,
  69. the characters Space and Delete are not part of ASCII per se, but rather
  70. separate components that must always be available in the presence of a
  71. 94-character graphics set.
  72.  
  73.    Similarly, ISO 8859-1 Latin Alphabet 1, which most of us think of as a
  74. coherent 8-bit character set is, in truth, composed of the ISO 646 control set
  75. (registration 001), the ISO 646 USA graphics set (006), the characters Space
  76. and Delete, a second 32-character control set (normally, but not necessarily,
  77. ISO 6429 [20], registration 077), and a 96-character set known as "The
  78. Right-hand Part of Latin Alphabet 1" (registration 100).  Each of these pieces
  79. except Space and Delete has its own unique registration number and designating
  80. escape sequence.  There is no single, unique identifier for the 8-bit Latin-1
  81. character set in its entirety.
  82.  
  83.   -----------------------------------------------------------------------------
  84.      <--C0--> <---------GL----------><--C1--> <---------GR---------->
  85.        00  01  02  03  04  05  06  07  08  09  10  11  12  13  14  15
  86.      +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
  87.   00 |       | SP                    |       | _ |                   |
  88.   01 |       |                       |       |                       |
  89.   02 |       |                       |       |                       |
  90.   03 |   C   |       ASCII           |   C   |        Special        |
  91.   04 |   o   |       graphics        |   o   |        Graphics       |
  92.   05 |   n   |                       |   n   |                       |
  93.   06 |   t   |                       |   t   |                       |
  94.   07 |   r   |                       |   r   |                       |
  95.   08 |   o   |                       |   o   |                       |
  96.   09 |   l   |                       |   l   |                       |
  97.   10 |   s   |                       |   s   |                       |
  98.   11 |       |                       |       |                       |
  99.   12 |       |                       |       |                       |
  100.   13 |       |                       |       |                       |
  101.   14 |       |                       |       |                       |
  102.   15 |       |                    DEL|       |                   , - |
  103.      +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
  104.      <--C0--> <---------GL----------><--C1--> <---------GR---------->
  105.   -----------------------------------------------------------------------------
  106.  
  107. Figure 1:  Structure of a Standard 8-Bit Single-Byte Character Set
  108.  
  109.  
  110.    In practice, most standard character sets have the same structure, which is
  111. illustrated in Figure 1:
  112.  
  113.  1. The 32-character control set of ISO 646 in columns 0 and 1.  This is
  114.     called the C0 region.
  115.  
  116.  2. The character Space at position 2/0.
  117.  
  118.  3. A 94-character graphics set in positions 2/1 through 7/14.  This is called
  119.     the Graphics Left, or GL, region.  For 7-bit character sets, these are the
  120.     84 characters of the ISO 646 International Reference Version plus 10
  121.     country-specific characters.  For 8-bit sets, these are the 94 graphic
  122.     characters of US ASCII.
  123.  
  124.  4. The character Delete at position 7/15.
  125.  
  126.  5. For 8-bit sets, a 32-character "right half" control set in columns 8 and
  127.     9.  This is the C1 region.
  128.  
  129.  6. For 8-bit sets, a 94- or 96-character "right half" graphics set in columns
  130.     10 through 15.  This is the Graphics Right or GR region.
  131.  
  132.  7. In multibyte graphic sets (not illustrated in the figure), each character
  133.     is composed of a fixed number of bytes, generally two, with each byte in
  134.     the graphic range, i.e. not corresponding to a C0 or C1 control character,
  135.     and following either the 94- or 96-character structure.  Thus, single-byte
  136.     control characters can be mixed with double-byte graphic characters with
  137.     no ambiguity.
  138.  
  139. The rationale for reserving an area for control characters in the right half
  140. of an 8-bit set is that communications devices tend to examine only the
  141. low-order 7 bits of a character when deciding whether it is a control or
  142. graphic character.  Placing graphic characters in columns 8 and 9 often
  143. triggers unwanted control functions.
  144.  
  145.    During the early decades of computing, when 7-bit communication was the
  146. rule, ISO 646 was the predominant method for representing the special
  147. characters of each language, and each European country had its own version of
  148. ISO 646.  But this imposed severe limitations on the user.  For example, ISO
  149. 646 makes it impossible to mix (say) German text and C-language programming
  150. syntax in the same file.  The following C program fragment:
  151.  
  152.   if (~(a[i] | x)) {
  153.       printf("Grⁿ▀e aus K÷ln\n");
  154.   }
  155.  
  156. can not be encoded in either ASCII or in German ISO 646, because neither set
  157. has all the required characters.  If German ISO 646 is used, German special
  158. characters are substituted for the braces, brackets, and bars:
  159.  
  160.   if (▀(a─i▄ ÷ x)) Σ
  161.       printf("Grⁿ▀e aus K÷ln╓n");
  162.   ⁿ
  163.  
  164. whereas if ASCII is chosen, we see the opposite effect:
  165.  
  166.   if (~(a[i] | x)) {
  167.       printf("Gr}~e aus K|ln\n");
  168.   }
  169.  
  170. Neither result is satisfactory, and matters only deteriorate when
  171. German-language program commentary is to be added.
  172.  
  173.    To alleviate these problems, many sites are switching to the ISO 8859 Latin
  174. alphabets.  However, the ISO 646 versions are still widely used, especially in
  175. electronic mail, a predominantly 7-bit medium.
  176.  
  177. Proprietary Character Sets
  178.  
  179. Most computers use either US ASCII [1] or IBM EBCDIC [13] as their basic
  180. character set.  But to support entry, display, printing, and processing of
  181. textual data in languages other than English, computer manufacturers soon
  182. recognized the need to extend these basic sets to allow representation of the
  183. accented Roman letters, non-Roman letters, ideograms, and other symbols used by
  184. the world's writing systems.
  185.  
  186.    Some manufacturers provide ISO 646 national versions, but users suffer with
  187. their limitations.  Besides the sacrifice of characters needed for programming,
  188. ISO 646 does not allow mixture of text in different languages, such as Italian,
  189. French, and Norwegian, in the same file.  So manufacturers such as Digital and
  190. IBM began to devise 8-bit international character sets for the European
  191. languages, as well as other sets for languages using other writing systems.
  192. Most of these 8-bit sets are capable of representing text in several languages,
  193. allowing a single product to serve, and work compatibly, over a broader market,
  194. for example all of Western Europe.
  195.  
  196.    Prominent among the proprietary sets are IBM's PC code pages [13].  They
  197. resemble an ISO Latin Alphabet by having ASCII in the left half, but depart
  198. from from the standard structure by using all of columns 8 through 15,
  199. including the C1 area, for graphic characters.  Thus IBM PC code pages have (at
  200. least) 32 more graphic characters than a standard 8-bit character set.  Major
  201. manufacturers including Apple and NeXT follow the IBM design, but with
  202. different character repertoires and encoding.  Others, notably Digital, Hewlett
  203. Packard, and Data General, observe the standard structure, usually with
  204. different repertoires and encoding.
  205.  
  206.    To add to the confusion, we also have IBM's many EBCDIC-based code pages,
  207. whose structure does not follow any national or international standard, as well
  208. as variations on IBM-like mainframes manufactured in Eastern Europe and the Far
  209. East, plus unknown numbers of proprietary sets from other manufacturers.
  210.  
  211. The Current Situation
  212. Today we are confronted with hundreds of different coded character sets, both
  213. standard and proprietary.  These sets differ in important ways:
  214.  
  215.  . Size: The total code space, 7-bit or 8-bit, single byte or multibyte.
  216.  . Structure: Standard or nonstandard allocation of control and graphics areas.
  217.  . Repertoire: The particular selection of characters.
  218.  . Encoding: The particular code values assigned to each character.
  219.  
  220. Every application-independent plain-text file is encoded in a particular
  221. character set.  It is generally not possible to mix character sets within a
  222. plain-text file.  Furthermore, a text file generally does not contain any
  223. indication of its character set.  Neither, in general, does the host operating
  224. system identify a file's character set, nor indeed, provide any mechanism to do
  225. so.
  226.  
  227.    Within most applications and computing environments, a certain character set
  228. is simply assumed.  When a workstation supports multiple character sets, or
  229. when data must be communicated between unlike computers, there is no automatic
  230. mechanism for software applications to identify a file's character set, and
  231. hence no way to automatically display its characters correctly, nor to announce
  232. the character set to another computer or application during data transfer.
  233.  
  234.    This problem has grown over the past decade as computers have become
  235. increasingly interconnected, and so are used increasingly for communication of
  236. text: news, conferencing, file transfer and sharing, and electronic mail.  Not
  237. only are text character sets likely to be incompatible, but there are no
  238. universally accepted methods for translation.
  239.  
  240. Character Set Translation
  241.  
  242. Characters, such as the letter A, are represented in the computer, and in
  243. telecommunications, by numeric codes.  Different computers use different codes
  244. for the same character.  For example, the letter A is code 65 in ASCII, code
  245. 193 in EBCDIC, and code 9025 in JIS X 0208.
  246.  
  247.    The most commonly used translation function is a simple array-indexing
  248. operation.  Suppose we are translating from character set A to character set B,
  249. and each set has 256 characters, and the characters in each set are represented
  250. by 8-bit code values in the range 0..255.  The translation is accomplished by a
  251. linear array of 256 8-bit elements called a translation table.  The table
  252. element at position i contains the translation from the character in set A
  253. whose code is i to the corresponding character in set B, namely its code in set
  254. B.  For example, the 65th element of an ASCII-to-EBCDIC translation table would
  255. be the number 193.
  256.  
  257.    During the translation process, a particular input character, c_in, in set A
  258. is translated to the output character, c_out, in set B by an array indexing
  259. operation as in this example, written in the C programming language:
  260.  
  261.   unsigned char a_to_b[256] = { ... };  /* Translation table */
  262.   unsigned char c_in, c_out;            /* Input and output characters */
  263.  
  264.   c_out = a_to_b[c_in];                 /* Translation function */
  265.  
  266. where the c_in variable is used as a subscript to the a_to_b array, and the
  267. notation { ... } stands for the initialization of the translation table.  In
  268. practice, the braces contain the quantities forming the table, in the
  269. appropriate order.
  270.  
  271.    In constructing a translation function between any pair of character sets,
  272. there are three important and often conflicting goals:
  273.  
  274.  1. Invertibility (I): After translating text from A to B, and then back to A,
  275.     is the result identical to the original?
  276.  
  277.  2. Readability (R): After translating text from A to B, is the result
  278.     readable? 
  279.  
  280.  3. Consistency (C): Are translations from A to B by different applications the
  281.     same?
  282.  
  283. In attempting to achieve these goals, we must look at the size, structure, and
  284. repertoire of the two character sets.  In many cases, the R-versus-I decision
  285. is forced upon us, but in others a choice is possible.  For example, consider
  286. translating between two character sets of the same size: Latin-1 and
  287. Latin/Cyrillic.  An invertible translation is possible that will not be
  288. readable, and a readable translation is possible that is not invertible.  In
  289. cases like this, the best course is to let the user set the translation goal.
  290.  
  291. Invertibility
  292.  
  293. Invertibility is important in cases where the exact contents of the file is
  294. important, or when the goal of data transfer is not necessarily final usage.
  295. Suppose, for example, you compose a C-language program (in ASCII) on your PC,
  296. transfer it to an IBM mainframe (where it is converted to EBCDIC), work on it
  297. some more, and then transfer it back to your PC.  If the character-set
  298. translation from the PC to the mainframe and back is not invertible, you will
  299. likely not be able to compile the program again on your PC without syntax
  300. errors.
  301.  
  302.    An invertible translation from character set A to character set B is
  303. possible only if A is smaller than or the same size as B.  Similarly, an
  304. invertible translation from character set B to character set A is possible only
  305. if B is smaller than or the same size as A.  So it follows that invertibility
  306. can be achieved in both directions only if the two character sets are the same
  307. size.  The following discussion applies only to bidirectional invertibility.
  308.  
  309.    The intersection of the two character sets A and B, written A <I> B, is 
  310. the set of characters, c, that both sets have in common, that is, all the
  311. characters are members of (<e>) both A and B:
  312.  
  313.     A <I> B  =  { c : c <e> A, c <e> B }
  314.  
  315. The characters in A that are not in B can be written as:
  316.  
  317.     A \  B  =  { c : c <e> A, c <!e> B }
  318.  
  319. and the characters in B that are not in A are:
  320.  
  321.     B \  A  =  { c : c <e> B, c <!e> A }
  322.  
  323.    To make an invertible translation table, the characters of A <I> B are
  324. paired together: the letter "E" in one set to "E" in the other, "╚" in one set
  325. to "╚" in the other, and so on.  The characters in A \ B are paired 1-to-1
  326. with the characters in B \ A according to some criterion: readability,
  327. consistency, whimsy, or caprice.  The exact method for pairing the leftovers
  328. is problematic, and frequently a particular pair makes no sense at all, for
  329. example "L-with-stroke" with "Vulgar fraction 3/4".
  330.  
  331.    Any 1-to-1 pairing will give an invertible translation, but to achieve the
  332. most useful translation it is necessary to examine all the character sets
  333. involved.  To illustrate, Latin Alphabet 1 lacks the OE digraph character but
  334. this character is found in the Digital Multinational character set, the Apple
  335. Quickdraw set, the Hewlett Packard Roman8 set, the Data General International
  336. set, and the NeXT character set, but at different code points in each.
  337. Ideally, the translations for each of these character sets would map OE
  338. digraph into the same Latin-1 code point, so that text translated from (say)
  339. NeXT to Latin-1 and thence to Data General would keep its OE intact.  But this
  340. would require an unprecedented degree of cooperation among competing
  341. manufacturers.
  342.  
  343.    The construction of invertible translations between private and standard
  344. character sets is beyond the scope of the national and international standards
  345. organizations, nor should these translations be made arbitrarily by
  346. programmers.  Translation tables (or algorithms) are most appropriately
  347. furnished by the creators or owners of each private character set.  This lends
  348. the appropriate "official" air and allows all software developers to use the
  349. same translations, thus promoting interoperability of diverse applications.
  350. In 1990, IBM became one of the few computer manufacturers to take this step
  351. when it published invertible tables between ISO 8859-1 and its code pages 500
  352. and 850 in its Character Data Representation Architecture Registry [13].
  353.  
  354.    Other translations, however, are lacking from IBM, for example between its
  355. Cyrillic code pages and the ISO Latin/Cyrillic alphabet; similarly for Hebrew,
  356. Arabic, Greek, and so on.  Official invertible translations of any kind seem
  357. to be entirely lacking from most other computer and software makers.
  358.  
  359. A Simple Rule
  360.  
  361. In the absence of an official translation, a simple procedure can be used to
  362. produce consistent invertible translations across all applications.  Let us
  363. assume that P is a private nonstandard character set, and that S is a standard
  364. character set, and that P and S are the same size, n.  Follow these steps to
  365. construct the translation table from P to S as an array, p_to_s, of n
  366. elements:
  367.  
  368. 1.  The characters that are common to P and S, P <I> S, are mapped together.
  369.     For each such character in P, whose code value is i, p_to_s[i] takes the
  370.     corresponding character's code value from S.
  371.  
  372. 2.  The members of A \ B and B \ A are paired with each other in code order.
  373.  
  374. This procedure guarantees that p_to_s has exactly n unique elements.
  375.  
  376.    Step (1) is not always easy.  All too frequently, private character sets
  377. are documented only by tables showing the graphic characters, often unclearly
  378. (as when working from a fax of third-generation photocopy), with no names or
  379. other identifiers assigned to the characters.  Even when the material is
  380. legible and names are assigned, conventions for graphic representation differ,
  381. and so do the names.  Thus, some knowledge of languages, writing systems,
  382. world and corporate cultures, history, and politics is helpful.
  383.  
  384.    Let's say that character set P consists of four characters, the letters A,
  385. B, C, and D, whose code values are 0, 1, 2, and 3, respectively.  And set S
  386. consists of the letters B, X, A, and Y, also with code values 0, 1, 2, and 3,
  387. in that order.  The letters A and B are common to both sets.  A is represented
  388. by code 0 in P and by code 2 in S, so:
  389.  
  390.     p_to_s[0]  =  2
  391.  
  392. Similarly for the letter B:
  393.  
  394.     p_to_s[1]  =  0
  395.  
  396. Positions 2 and 3 of our translation array remain empty, so we assign them in
  397. code order:
  398.  
  399.     p_to_s[2]  =  1
  400.     p_to_s[3]  =  3
  401.  
  402. and the translation from P to S is complete.  Each element of the p_to_s array
  403. has a unique value.
  404.  
  405.    To create the reverse translation table from S to P, s_to_p, we could
  406. repeat the process in the reverse direction, or, equivalently (and more
  407. safely), simply turn the p_to_s table "inside out" by sorting it according to
  408. its values.  Here is a C language program fragment that does the job:
  409.  
  410.   for (i = 0; i < n; i++)
  411.     s_to_p[p_to_s[i]] = i;
  412.  
  413.    This leaves us with the two translation tables:
  414.  
  415.    Index  p_to_s  s_to_p
  416.      0       2       1
  417.      1       0       2
  418.      2       1       0
  419.      3       3       3
  420.  
  421.    Naturally, such an arbitrary method will please few (hence the foregoing
  422. plea for more-sensible official invertible translations); in this case C
  423. becomes X and vice versa.  But vice-versa is exactly what is needed for
  424. invertibility and consistency.  Those characters the two sets have in common
  425. are translated readably, and the rest are translated according to the Simple
  426. Rule for consistent invertibility.
  427.  
  428.    In a more useful application of the Simple Rule, let us construct an
  429. invertible mapping between two real-life, 8-bit, single-byte character sets,
  430.  
  431.  
  432.        COMPUTER A                                COMPUTER B
  433.   +------------------+                      +------------------+
  434.   | +-------------+  |                      |  +-------------+ |
  435.   | | Translation |  |      Transfer        |  | Translation | |
  436.   | | Function:   |--------------------------->| Function:   | |
  437.   | | FCS to TCS  |  |    Character Set     |  | TCS to FCS  | |
  438.   | +-------------+  |                      |  +-------------+ |
  439.   |       ^          |                      |        |         |
  440.   |       |          |                      |        v         |
  441.   |  Kermit Program  |                      |  Kermit Program  |
  442.   |      SEND        |                      |     RECEIVE      |
  443.   +------------------+                      +------------------+
  444.           ^                                          |
  445.           |                                          v
  446.   +------------------+                      +------------------+
  447.   |  Local File      |                      |  Local File      |
  448.   |  Character Set A |                      |  Character Set B |
  449.   +------------------+                      +------------------+
  450.  
  451. Figure 2:  File Transfer Character-Set Translation
  452.  
  453.  
  454. Data General International (DGI) [7] and ISO 8859-1 [18], between which there
  455. is no official invertible mapping.  We begin by finding all the characters
  456. from DGI that are also in Latin-1 (80 of them) and make the appropriate
  457. mappings.  We are left with two lists of sixteen unmatched characters.
  458. Applying the Simple Rule, the lists are sorted in code order and placed
  459. side-by-side to obtain the following correspondence:
  460.  
  461.   160  Undefined                      160  No-break space
  462.   175  Double dagger                  166  Broken bar
  463.   179  Trade mark uncircled           173  Soft hyphen
  464.   180  Florin sign                    175  Macron
  465.   183  Less-than-or-equal sign        184  Cedilla
  466.   184  Greater-than-or-equal sign     185  Superscript one
  467.   186  Grave accent                   188  Vulgar fraction one quarter
  468.   191  Up arrow                       190  Vulgar fraction three quarters
  469.   215  Capital OE digraph             208  Capital Icelandic letter Eth
  470.   220  Undefined                      215  Multiplication sign
  471.   221 Uppercase letter Y diaeresis    221  Capital letter Y with acute accent
  472.   222 Undefined                       222  Capital Icelandic letter Thorn
  473.   223 Undefined                       240  Small Icelandic letter eth
  474.   247 Small oe digraph                247  Division sign
  475.   254 Undefined                       253  Small letter y with acute accent
  476.   255 Fill character light            254  Small Icelandic letter thorn
  477.  
  478. So if P is DGI and S is Latin-1, then p_to_s[160] = 160, p_to_s[175] = 166,
  479. ..., p_to_s[255] = 254, and the P to S mapping is complete.  The s_to_p array
  480. is obtained by exchanging the index and value of each p_to_s element, as in
  481. the program fragment given above.
  482.  
  483. Readability
  484.  
  485. Bidirectional invertibility cannot be achieved when the character sets are
  486. different sizes, nor can invertibility be achieved from a larger set to a
  487. smaller set.  In such cases, readability becomes the only sensible translation
  488. goal.  Even in cases where invertibility is possible, readability might be
  489. preferred for a particular data transfer.
  490.  
  491.    When translating from a larger set, A, to a smaller one, B, several
  492. different characters in A can be mapped to a single character in B.  For
  493. example, the following Latin-1 characters:
  494.  
  495. α  ß  Γ  π  Σ  σ  µ
  496.  
  497. might all be mapped to the letter "a" when translating to ASCII.  In the
  498. resulting ASCII file, we can't tell where a particular "a" came from, so we
  499. can't reconstruct the original Latin-1 text when translating in the reverse
  500. direction.  But the ASCII file is more intelligible than if we had used some
  501. other mapping, such as simply stripping off the high-order bit.  Translation
  502. by removing diacritics is useful with Roman-based languages, such as French;
  503. "pΓtΘ" becomes "pate" rather than (say) "pbti".  Or German: "Grⁿ▀e aus K÷ln"
  504. becomes "Gruse aus Koln" instead of "Gr|_e aus Kvln".
  505.  
  506.    In German, the words "Gruse" and "Grusse" have entirely different meanings
  507. (we don't want to say "soot" when we mean "greetings").  We can do better.
  508. European languages like German, Swedish, Norwegian, Danish, Icelandic, and
  509. Dutch have rules for converting accented or other special characters into
  510. unadorned ABC's.  For example, any German vowel with an umlaut (diaeresis) can
  511. be written without the umlaut and followed by the letter "e".  These rules are
  512. specific to each language.  So while we can write the German word "K÷ln" as
  513. "Koeln", we cannot write the English word "co÷peration" as "cooeperation".
  514.  
  515.    Such language rules can not be applied blindly in reverse.  For example, if
  516. "oe" were translated back to "÷", then "Kommandoebene" would become
  517. "Kommand÷bene" (not a German word), and AUTOEXEC.BAT would become AUT╓XEC.BAT
  518. (a PC file that you don't want to rename!).
  519.  
  520.    Construction of a readable translation between two entirely different
  521. alphabets, such as Cyrillic and Roman, is called transliteration.  The
  522. specific transliteration rules must take into account not only the alphabets
  523. themselves, but also what languages they represent.  For example, the surname
  524. of a former leader of the former USSR, [KRUSCHCHEV written in six Cyrillic
  525. letters looking somewhat like KRYWEB], is transliterated into Roman letters
  526. as "Khrushchev" in English, but into "Khruschtschew" in German.
  527.  
  528.    Newspapers and magazines, libraries, immigrant bureaus, and other
  529. organizations have their own standard procedures for transliterating "foreign"
  530. writing systems.  Not just in "ASCII-speaking" lands, but everywhere: Russian
  531. names are written in Arabic newspapers, Hebrew names in Greek journals,
  532. English names on Chinese passports, Korean publications in Vietnamese library
  533. catalogs.  But these standards are not widely known.  When a standard can be
  534. found, use it.  If not, look harder.
  535.  
  536.  
  537. CHARACTER-SET TRANSLATION IN THE KERMIT FILE TRANSFER PROTOCOL
  538.  
  539. The Kermit File Transfer Protocol was developed at Columbia University to
  540. allow the transfer of both text and binary files among all types of personal
  541. computers, minicomputers, and mainframes, in both the 7-bit and 8-bit
  542. communication environments.  Kermit is a layered, point-to-point,
  543. transport-independent, error-correcting packet protocol described in detail
  544. elsewhere [5].
  545.  
  546.    Transfer of text files between unlike computers requires conversion of both
  547. record format and character set at the presentation layer.  For example, a
  548. document composed under the UNIX operating system using the ASCII character
  549. set with lines separated by imbedded Linefeed characters, upon transfer to an
  550. IBM mainframe, is converted to EBCDIC encoding and a mainframe-specific
  551. variable- or fixed-length record format.  Kermit accomplishes this conversion
  552. with another Simple Rule: during file transfer, the character set used for
  553. text files is ASCII, and the record format is stream, with records (lines)
  554. delimited by Carriage Return and Linefeed.
  555.  
  556.    Thus, it is the responsibility of each Kermit program to convert between
  557. the text character sets and record formats of its own computer and the
  558. standard Kermit format.  This means that no Kermit program needs to know the
  559. specific codes and formats of any kind of computer except its own, and it
  560. forms the basis of Kermit's strategy for converting between different
  561. character sets.  This idea is known as a "common intermediate representation,"
  562. and it lies at the heart of any presentation-layer protocol [26].
  563.  
  564.    By the mid 1980s, Kermit had become a de facto standard for file transfer.
  565. Kermit software programs had been written for almost every kind of computer in
  566. existence.  But the Kermit protocol lacked a formal and consistent means for
  567. exchanging text that contained non-Roman or accented Roman characters.  Files
  568. could be transferred, but the results would be gibberish unless the receiving
  569. computer supported the same character set as the sender.
  570.  
  571.    At first, this problem was remedied by pre- or postprocessing.  But this
  572. approach places an unreasonable burden on the user.  Not only must extra steps
  573. be taken, but a suitable translation utility must be found for every pair of
  574. character sets.  More subtly, translation utilities (for example, between an
  575. IBM code page and a Macintosh character set) are constructed in an ad-hoc
  576. manner, with no guarantee of consistency from one utility to another.
  577.  
  578.    The problem is compounded by the rapid proliferation of proprietary,
  579. national, and international standard character sets.  By the late 1980s, there
  580. were many encodings for each major writing system, a problem pointed out by
  581. attendees at international conference sessions on Kermit in Europe and Japan
  582. [10].  A consistent approach to character-set translation had become an urgent
  583. matter.
  584.  
  585. Basic Design Principles
  586.  
  587. How can we enable meaningful exchange of text between any two computers?  The
  588. obvious approach is to require each data-transfer application to understand
  589. every character set in existence.  This works adequately when the number of
  590. sets is small and stable, but quickly becomes unwieldy and unmanageable as the
  591. number increases.  If the number of character sets is n, the number of
  592. translations is:
  593.  
  594.    ( n )         n !     
  595.    (   ) =  -----------  =  n  *  (n - 1)                                (1)
  596.    ( 2 )    2! * (n-2)!
  597.  
  598. If we have two character sets, A and B, we need two translations, one from A
  599. to B and one from B to A.  If we have three sets -- A, B, and C -- we need
  600. 3 * 2 = 6 translations: AB, BA, AC, CA, BC, and CB.  And so on.
  601.  
  602.    Now consider that in 1990, IBM alone listed 276 different coded
  603. character-set identifiers in its registry [13].  If we wanted translations
  604. between every pair of IBM character sets, there would be 75,900 of them!  Add
  605. in all the other sets from all the other companies to appreciate the magnitude
  606. of the problem.
  607.  
  608.    By using a standard intermediate representation for each type of character
  609. set (Roman, Cyrillic, Hebrew, Japanese, etc), we eliminate the need for any
  610. particular computer to know about the character sets used by any other kind of
  611. computer.  Kermit's common intermediate character set, previously always
  612. ASCII, is now allowed to be any of a small number of character sets.  The set
  613. used during a particular file transfer is called the transfer character set
  614. (TCS).
  615.  
  616.    The character set of the file that is being sent or received is called the
  617. file character set (FCS).  The sender translates from its local codes (the
  618. FCS) to the standard ones (the TCS), and the receiver translates from TCS
  619. codes to its own FCS, as shown in Figure 2.
  620.  
  621.    For a particular file and transfer character set combination, a Kermit
  622. program has one translation function for sending files and another for
  623. receiving them.  Theoretically, all combinations of file and transfer
  624. character set are allowed.  Thus the number of translation functions, f, is
  625. given by:
  626.  
  627.     f = tcs * fcs * 2                                                     (2)
  628.  
  629. That is, one function in each direction, for each combination of TCS and FCS.
  630. While this number is significantly lower than the number of pairs of all
  631. character sets (Equation 1), we still want to reduce it to conserve computer
  632. memory and cut down on user confusion.
  633.  
  634. The Transfer Character Set
  635.  
  636. Generally, we want to support all the file character sets used on a particular
  637. computer, so the way to keep the total number of translation functions small
  638. is to minimize the number of transfer character sets that can handle the given
  639. selection of file character sets.  This is done, in part, by restricting the
  640. set of possible transfer character sets to a small number according to the
  641. following rules:
  642.  
  643.  1. The transfer character set must be a national or international standard
  644.     character set registered with the ISO, or a combination of such sets.
  645.     This means that its structure is consistent with other standard character
  646.     sets and that it has a unique identifier.  Furthermore, it means that the
  647.     character set is well known, its specification is readily available, and
  648.     the characters have names.
  649.  
  650.  2. US ASCII [1] is included for compatibility with the original Kermit
  651.     protocol and with unextended Kermit programs.
  652.  
  653.  3. The ISO 8859 Latin Alphabets [18] are included.
  654.  
  655.  4. The ISO-registered Chinese [4], Japanese [22, 23, 24], and Korean [25]
  656.     sets are included.  These are usually used in conjunction with one or more
  657.     single-byte sets that provide control characters and single-width ASCII or
  658.     ISO 646 graphics.
  659.  
  660.  5. Additional sets, such as (for example) Vietnamese VSCII [8, 28], can be
  661.     included if they are registered with the ISO, as long as they are not
  662.     proper subsets of any of those already included.
  663.  
  664.  6. All else being equal, a simple and compact representation is preferred.
  665.  
  666.    The national versions of ISO 646 [14] (other than US ASCII) are not
  667. included because of Rule 5; these sets are covered adequately by the ISO Latin
  668. alphabets.  CCITT (ITU-T) T.61 [2], which represents accented characters
  669. exclusively by composition, is not included for reasons 1, 5, and 6.
  670.  
  671.    Table 1 lists the transfer character sets presently allowed by the Kermit
  672. protocol.  The Kermit Name allows uniform reference to these sets by Kermit
  673. software users.  The requirement for ISO registration provides for unique and
  674. incontestible identifiers for Kermit's transfer character sets.  The Kermit
  675. Designator is the means by which the sending Kermit program informs the
  676. receiver of the transfer character set, a key part of the presentation
  677. protocol.  As noted earlier, however, ISO standards do not provide a single
  678. designator for a complete character set, but rather separate designators for
  679. its pieces.  Thus Latin-1 is designated as "I6/100", meaning that the left
  680. half (G0) is ASCII and the right half (G1) is "the Right-hand Part of Latin
  681. Alphabet 1."  The C0 and C1 control regions are not explicitly designated.
  682. The C0 region is assumed to be the normal ASCII and ISO 646 control set, with
  683. format effectors used to delimit records and so on.  The C1 set is assumed to
  684. be ISO 6429 to allow the use of character-set shifting functions such as SS2
  685. and SS3 [15], for example in Japanese EUC.
  686.  
  687.    In the Kermit Designator, the initial letter "I" indicates ISO registration
  688. numbers for character sets, leaving open the possibility for other
  689. registration authorities.  Japanese EUC (Extended UNIX Code) is a special
  690. case, having three parts, chosen in preference to JIS X 0208 alone to allow
  691. the commonly used mixture of single-width and double-width characters.  The
  692. registration numbers are listed in G0/G1/G2 order, so SS2 is required to shift
  693. between Kanji (ISO 87) and Katakana (ISO 13) in accordance with ISO 2022.
  694.  
  695.    This notation is used in preference to, say, the name of the standard
  696. itself (for example "ISO8859-1") because the same character set can be defined
  697. by more than one standard (for example, Latin-1 and ECMA 94), and one standard
  698. can specify more than one character set (e.g. ISO 646).
  699.  
  700.    Using a standard international character set as the TCS, it is possible to
  701. transfer text written in a language other than English between unlike
  702. computers, and it is usually also possible to transfer text containing a
  703. mixture of languages.  For example, text in Latin Alphabet 1 might contain a
  704. mixture of Italian, Norwegian, French, German, English, and Icelandic.
  705.  
  706.    A particular Kermit program need not incorporate all the defined transfer
  707. character sets.  In many cases, a single 8-bit set will suffice, such as
  708. LATIN1 for Western Europe, LATIN2 for Eastern European languages with
  709. Roman-based writing systems, CYRILLIC for Russia, and so on.  Thus Equation 2
  710. generally results in a comfortably small number.  For example, an IBM PC that
  711. supports five Roman-alphabet code pages for Western European languages plus a
  712. Cyrillic code page can be used with two transfer character sets, LATIN1 and
  713. CYRILLIC for a total of 24 translation functions.
  714.  
  715.    When a language is representable in more than one set from Table 1, as are
  716. English, German, Finnish, Turkish, Greek, Russian, etc., the character set
  717. highest on the list that adequately represents the language should be used.
  718. For example, ASCII should be used for English.  Within the ISO 8859 family,
  719. lower-numbered sets that contain all the characters of interest are preferred
  720. to higher-numbered sets containing the same characters.
  721.  
  722.    This guideline maximizes the chance that any two particular Kermit programs
  723. will interoperate.  For example, LATIN1 would be chosen for French, German,
  724. Italian, Spanish, Danish, Dutch, Swedish, etc; LATIN3 for Turkish;
  725. JAPANESE-EUC for Japanese text that includes Kanji characters, KATAKANA for
  726. Japanese text that includes only Roman and Katakana characters, and so on.
  727.  
  728.    If a file containing a mixture of languages, say English, Finnish, and
  729. Latvian, must be transferred, the user must find a transfer character set that
  730. can adequately represent all three languages, in this case Latin Alphabet 4.
  731. For a mixture of Norwegian and Turkish, Latin-5 must be used, and so on.
  732.  
  733.    The user can employ this flexibility to achieve useful effects.  For
  734. example, since there is no requirement that a Cyrillic file be transferred
  735. using a Cyrillic transfer character set, the user can transliterate between
  736. Cyrillic and Roman characters as part of the file transfer process.
  737.  
  738. The Translation Function
  739.  
  740. A typical Kermit program contains an m * n * 2 matrix of translation
  741. functions, where m is the number of supported file character sets, n is the
  742. number of supported transfer character sets (including the transparent set,
  743. which indicates that no translation is to be done), and there are two tables
  744. for each combination, one for sending and one for receiving.  The translation
  745. function is selected when the user identifies the file and transfer character
  746. sets and then sends or receives a file.
  747.  
  748.    The normal behavior of a particular function can be altered in several
  749. ways.  The user can override its default translation goal, and when the goal
  750. is readability (as it must be when translating from a larger to a smaller
  751. set), language-specific rules can be invoked.
  752.  
  753.    The function itself can work by any combination of algorithm, translation
  754. table, exception list, and shameless tricks.  For example, an invertible
  755. translation between IBM Code Page 437 and Latin Alphabet 1 would be a simple
  756. indexing operation into a table, but a translation from Japanese EUC to the PC
  757. "Shift JIS" code is normally accomplished by a tableless algorithm.
  758. Translation from Latin-1 to ASCII with German language rules could be done
  759. with a combination of table accesses and exception lists.  To accomplish the
  760. desired translation, each Kermit program needs to know:
  761.  
  762.  . The local file character set.
  763.  
  764.  . The transfer character set to be used.
  765.  
  766.  . The translation goal, invertibility or readability.
  767.  
  768.  . For readable translations, optionally, the language and a corresponding 
  769.    set of language-specific rules.
  770.  
  771. In most situations, some or all of these are implicit, and no particular
  772. efforts are required.  To illustrate, suppose that you have an IBM PC on your
  773. desk, and the PC is connected to a Hewlett Packard (HP) timesharing computer.
  774. The PC uses IBM code page 850 and the timesharing computer uses the HP Roman8
  775. Set.  In that case, your PC's file character set is always CP850, the
  776. timesharing computer's file character set is always HP Roman8, and the
  777. transfer character set is always Latin-1.  These items can be set in your
  778. Kermit profiles, and the appropriate translations will always occur
  779. automatically.
  780.  
  781.    On the other hand, suppose you must occasionally write some text in German
  782. and send it from your PC to another computer that supports only ASCII.  In
  783. this case you would override your Kermit profiles by specifying a transfer
  784. character set of ASCII, which automatically activates the readability goal,
  785. and you might also choose to elect language-specific rules for German.
  786.  
  787. Examples
  788.  
  789. Let's look at a few of many possible translation scenarios.  Each one presents
  790. its own set of problems requiring decisions by the creator of the translation
  791. function, or by the user.
  792.  
  793.  
  794. Table 1:  Kermit Transfer Character Sets
  795. ------------------------------------------------------------------------------
  796.                               ISO
  797.  Kermit                       Registration  Kermit
  798.  Name          Standard       Number        Designator  Languages
  799. ------------------------------------------------------------------------------
  800.  ASCII         ANSI X3.4              6     (none)      English, Latin
  801.  
  802.  LATIN1        ISO 8859-1           100     I6/100      Danish, Dutch, English,
  803.                                                         Faeroese, Finnish, 
  804.                                                         French, German, 
  805.                                                         Icelandic, Irish, 
  806.                                                         Italian, Norwegian, 
  807.                                                         Portuguese, Spanish,
  808.                                                         and Swedish.
  809.  
  810.  LATIN2        ISO 8859-2           101     I6/101      Albanian, Czech, 
  811.                                                         English, German, 
  812.                                                         Hungarian, Polish, 
  813.                                                         Romanian, Croatian,
  814.                                                         Slovak, and Slovene.
  815.  
  816.  LATIN3        ISO 8859-3           109     I6/109      Afrikaans, Catalan, 
  817.                                                         Dutch, English, 
  818.                                                         Esperanto, French, 
  819.                                                         Galician, German, 
  820.                                                         Italian, Maltese,
  821.                                                         Spanish, and Turkish.
  822.  
  823.  LATIN4        ISO 8859-4           110     I6/110      Danish, English, 
  824.                                                         Estonian, Finnish,
  825.                                                         German, Greenlandic, 
  826.                                                         Sami, Latvian,
  827.                                                         Lithuanian, Norwegian,
  828.                                                         and Swedish.
  829.  
  830.  LATIN5        ISO 8859-9           148     I6/148      Danish, Dutch, English,
  831.                                                         Faeroese, Finnish,
  832.                                                         French, German, Irish,
  833.                                                         Italian, Norwegian
  834.                                                         Portuguese, Spanish, 
  835.                                                         Swedish, and Turkish.
  836.  
  837.  CYRILLIC      ISO 8859-5           144     I6/144      Bulgarian, Belorussian,
  838.                                                         English, Macedonian,
  839.                                                         Russian, Serbocroatian
  840.                                                         (Serbian), Ukrainian.
  841.  
  842.  ARABIC        ISO 8859-6           127     I6/127      Arabic
  843.  
  844.  GREEK         ISO 8859-7           126     I6/126      Greek
  845.  
  846.  HEBREW        ISO 8859-8           138     I6/138      Hebrew
  847.  
  848.  KATAKANA      JIS X 0201        14, 13     I14/13      Japanese (Roman and
  849.                                                         Katakana)
  850.  
  851.  JAPANESE-EUC  JIS X 0201,       14, 13     I14/87/13   Japanese (Roman, 
  852.                JIS X 0208            87                 Katakana, Hiragana,
  853.                                                         Kanji), English, Greek,
  854.                                                         Russian.
  855.  
  856.  CHINESE       CS GB 2312-80         58     I55/58      Chinese (Roman, 
  857.                                                         Phonetic, and Hanzi),
  858.                                                         Japanese (Roman, 
  859.                                                         Katakana, Hiragana),
  860.                                                         English, Greek, Russian
  861.  
  862.  KOREAN        KS C 5601            149     I6/149      Korean (Hangul, Hanja),
  863.                                                         Japanese (Roman, 
  864.                                                         Katakana, Hiragana), 
  865.                                                         Greek, Russian, 
  866.                                                         English, and others
  867.  
  868.  VIETNAMESE    TCVN 5712            180     I6/180      Vietnamese
  869. ------------------------------------------------------------------------------
  870.  
  871.  1. From a 7-bit set to a different 7-bit set, e.g. from the Spanish version
  872.     of ISO 646 to ASCII (or vice versa).  The two sets do not contain the same
  873.     characters.  Here we must choose between readability (R) and invertibility
  874.     (I).  To achieve readability in the Spanish-to-ASCII direction, we strip
  875.     diacritical marks (n-tilde becomes simply n, and so on).  To achieve
  876.     invertibility, we make no translation at all.
  877.  
  878.  2. From a 7-bit set to an 8-bit set.  The 7-bit sets are usually ASCII or an
  879.     ISO 646 national version.  Often, all the characters from the 7-bit set
  880.     are also present in the 8-bit set, and there is no R-versus-I conflict.
  881.     For example: ASCII (and most ISO 646 national variants) to Latin-1 --
  882.     here we satisfy both R and I. In other cases we must choose between R and
  883.     I. For example: the ISO 646 Italian national variant to ISO Latin /
  884.     Arabic: here we either remove the accents for readability, or map the
  885.     accented characters into right-half characters for invertibility.
  886.  
  887.  3. From an 8-bit set to another 8-bit set.  A common case is converting
  888.     between one of the corporate "extended ASCII" sets (Digital, IBM, HP,
  889.     Apple, NeXT, Data General) and ISO Latin-1.  The two sets share a large
  890.     percentage of common characters.  How do we handle the characters that
  891.     differ?  Again, we must choose between R and I. To complicate matters, the
  892.     IBM, Apple, and NeXT sets use the forbidden C1 control-character area for
  893.     graphic charac- ters.  To create an invertible translation in the absence
  894.     of an official corporate standard, we use the Simple Rule.
  895.  
  896.  4. From an 8-bit set to a 7-bit set.  For example, from Latin-1 to ASCII or
  897.     to an ISO 646 national set.  Here we are forced to accept a large amount
  898.     of information loss.  We cannot possibly achieve invertibility, so we aim
  899.     for maximum readability, for example by removing diacritics or invoking
  900.     language-specific rules.
  901.  
  902.  5. From a single-byte character set to a multibyte character set.  Most mul-
  903.     tibyte character sets include ASCII and sometimes several other alphabets
  904.     (such as Greek and Cyrillic).  Here we translate each character into its
  905.     equivalent, if it has one.  When it doesn't, we must choose between R and
  906.     I. For example, "╓" is not found in JIS X 0208 so it can be mapped to "O"
  907.     for readability, or some unique value (preferably one unassigned in JIS X
  908.     0208) for invertibility.
  909.  
  910.  6. From a multibyte set to a single-byte set, for example Japanese JIS X
  911.     0208 into Latin-1 (or Latin/Cyrillic, Latin/Greek, or even ASCII).  An
  912.     invertible translation is clearly impossible.  A readable translation
  913.     would require rendering Kanji ideograms phonetically or translating them
  914.     into an entirely different language, clearly beyond the scope of a
  915.     character-set conversion scheme.
  916.  
  917. 7.  From one national multibyte set to another.  These sets are for Chinese,
  918.     Japanese, and Korean, and have a very large number of characters --
  919.     ideograms, ASCII graphics, Greek, and Cyrillic characters -- in common.
  920.     They also have large blocks of unassigned character positions, so the
  921.     characters they do not share in common (such as the Chinese phonetic
  922.     symbols that are absent from the standard Japanese set) can be assigned
  923.     to these areas to preserve invertibility.
  924.  
  925. No two programmers are likely make the same decisions and this will lead to
  926. inconsistent translations (unless the Simple Rule is followed).  This
  927. emphasizes the need for officially published translations between the private
  928. and standard sets.  And as this list suggests, we also need translations
  929. between some of the standard sets themselves, for example Chinese and Korean.
  930. This need is addressed to some extent by the Unicode books [27], which
  931. include the mappings from various character sets to the Unicode set.
  932.  
  933. Performance
  934.  
  935. Character-set translation in itself does not affect the performance of the
  936. Kermit file transfer protocol to any significant degree.  The introduction of
  937. per-character translation introduces an extra table access or function call
  938. but the extra work is usually minimal.  In general, the bottlenecks are
  939. elsewhere.
  940.  
  941.    One of the strong points of the Kermit protocol is its ability to transfer
  942. 8-bit data in the 7-bit communication environment.  This is done using a
  943. single shift, or prefixing, technique in which each 8-bit character is
  944. stripped of its 8th bit and then prefixed by a special shift-indicating
  945. character.  This results in negligible overhead for English and Western
  946. European text (such as French, German, Italian).
  947.  
  948.    But for text in "right-handed" languages like Russian, Greek, Hebrew, and
  949. Arabic, where text characters come predominantly from the right half of the
  950. character set, single shifts can result in up to 80% overhead.  The situation
  951. is even worse for Japanese EUC, in which all Kanji bytes have their 8th bits
  952. set to 1, resulting in transmission overhead of 100% for pure Kanji text on a
  953. 7-bit connection.
  954.  
  955.    Because 7-bit communication is still prevalent, Kermit's support for
  956. Greek, Cyrillic, Hebrew, Arabic, and Japanese text file transfer calls for a
  957. more efficient technique.  This was accomplished by adding a locking shift
  958. mechanism to the Kermit protocol, allowing sequences of 8-bit characters to
  959. be transmitted in 7-bit form with shifting overhead applying to entire 8-bit
  960. sequences, rather than to each 8-bit character.  Isolated 8-bit characters
  961. can still be transmitted using single shifts.  These methods are very similar
  962. to those of ISO 2022, but without the risk of "loss-of-state" due to
  963. corruption or loss of the shift characters, and with the addition of the
  964. "single-shift-1" mechanism lacking from ISO 2022.  A combination of single
  965. and locking shifts can achieve maximum efficiency by using a lookahead
  966. technique.  A detailed specification is given elsewhere [12].
  967.  
  968.    The addition of locking shifts to the Kermit protocol increases the
  969. transfer efficiency on 7-bit connections for typical Cyrillic text by about
  970. 50% and for typical Kanji text by more than 90%, bringing these transfers to
  971. within the efficiency range of normal 7-bit ASCII transfers on the same
  972. connections.
  973.  
  974.  
  975. CONCLUSIONS AND RECOMMENDATIONS
  976.  
  977. File transfer character-set translation is an optional feature for Kermit
  978. programs, and is designed to interoperate (with, of course, no claim to
  979. correct translation) with Kermit programs that do not support it.  As of this
  980. writing, translation of (at least) Roman, Cyrillic, Hebrew, and Japanese text
  981. is supported by MS-DOS Kermit for the IBM PC [9], IBM mainframe Kermit for
  982. VM, MVS, and CICS [3], and C-Kermit for UNIX, VMS, OS/2, and other operating
  983. systems [6].  Three basic commands were added to these programs to select the
  984. file and transfer character sets and any desired language-specific
  985. translation rules.  Locking shifts are used automatically in the 7-bit
  986. communication environment to prevent Kermit from discriminating against
  987. "right-handed" character sets.  Kermit programs equipped with the new
  988. translation features have become popular in Europe, Latin America, the former
  989. Soviet Union, and Japan.  Work is in progress to add further translation
  990. capabilities for other parts of the world.
  991.  
  992.    Space has not permitted discussion of the details of the Kermit protocol,
  993. the forms of the commands, translation negotiation and refusal mechanisms,
  994. unilateral and local translation features, automatic matching of file and
  995. transfer character sets, character sets in terminal emulation, and numerous
  996. other issues.  These will be covered in a future edition of reference [5].
  997.  
  998.    In the discussions that resulted in the character-set translation
  999. extension to Kermit, the most fundamental lesson we have learned is that if
  1000. existing standards can solve a particular problem, they should be used
  1001. instead of inventing new techniques to solve the same problem.  Applying this
  1002. lesson to Kermit file transfer results in the following conclusions:
  1003.  
  1004.  1. Only ISO-registered standard character sets should be used for
  1005.     interchange.  This eliminates the need for any computer to support any
  1006.     character sets except its own and the corresponding well-known standards.
  1007.  
  1008.  2. The sender should identify the transfer character set to the receiver
  1009.     using a standard notation such as its ISO registration number.  This
  1010.     eliminates the need for setting up separate and redundant registration
  1011.     authoritities for character-set identifiers.
  1012.  
  1013.  3. Translations should be invertible, readable, and consistent.  When all
  1014.     three of these goals cannot be achieved by a single translation, the user
  1015.     should be able to choose the translation goal.
  1016.  
  1017. These principles can be applied to any form of textual data interchange,
  1018. including electronic mail, network file systems, terminal emulation, virtual
  1019. terminal service, distributed databases, remote procedure calls, cutting and
  1020. pasting among object-oriented applications, and so on.
  1021.  
  1022.    The translation process itself, however, remains ill-defined.  It is hoped
  1023. that the industry and the standards organizations will take the following
  1024. steps:
  1025.  
  1026.  1. Standard character sets should be used in preference to private character
  1027.     sets.
  1028.  
  1029.  2. Owners of private character sets should publish official invertible
  1030.     translations to ISO-registered standard sets.  In the absence of official
  1031.     translations, a simple procedure such as the one presented in this paper
  1032.     should be used to achieve consistent invertible translations across all
  1033.     applications.
  1034.  
  1035.  3. Standards organizations are encouraged to consider publishing
  1036.     translations between different standard character sets, such as the
  1037.     Japanese, Chinese, and Korean sets, as well as readable transliterations
  1038.     among different alphabetic writing systems, such as Roman, Greek, Hebrew,
  1039.     Arabic, and Cyrillic.
  1040.  
  1041.  4. Operating system designers should consider tagging plain-text files with
  1042.     character-set identifiers, like the Kermit tags listed in Table 1, to
  1043.     allow applications software to determine a file's character set
  1044.     automatically.  When standard character sets are used, their tags should
  1045.     be consistent across different operating systems.
  1046.  
  1047.    Ten or twenty years from now, perhaps all the computers, as well as all the
  1048. display, entry, printing, and telcommunication devices of the world will use
  1049. one universal character set, and the issues discussed in this paper will be
  1050. irrelevant.  On the other hand, perhaps the accumulated and ever-growing
  1051. installed base of existing hardware, software, and electronic information will
  1052. prove too massive for conversion and the universal character set will be just
  1053. one more character set on the list.
  1054.  
  1055.  
  1056. ACKNOWLEDGEMENTS
  1057.  
  1058. My deepest thanks to Christine M. Gianone of Columbia University for inspiring
  1059. the work and ideas described in this paper, and for her key contributions
  1060. thereto.  Special thanks also to the others who played prominent roles in the
  1061. design and development of Kermit's character-set translation capabilities: Joe
  1062. R. Doupnik of Utah State University, John Chandler of the Harvard / Smithsonian
  1063. Center for Astrophysics, Hirofumi Fujii of the Japan National Laboratory of
  1064. High Energy Physics in Tokyo, John Klensin of the United Nations University,
  1065. Andre Pirard of the University of Liege in Belgium, Johan van Wingen of the
  1066. Netherlands and numerous ISO committees, Gisbert W. Selke of the
  1067. Wissenschaftliches Institut der Ortskrankenkassen in Bonn, Germany, and
  1068. Konstantin Vinogradov of the International Centre for Scientific and Technical
  1069. Information (ICSTI) in Moscow.  Grateful acknowledgements also to Juri
  1070. Gornostaev and A. Butrimenko of ICSTI for hosting the First International
  1071. Kermit Conference in Moscow [11] in Spring 1989, where the ideas in this paper
  1072. received their first public hearing.  Thanks also to the many participants in
  1073. the ISO8859, UNICODE, and ISO10646 network discussion groups for valuable
  1074. information and insights.
  1075.  
  1076.  
  1077. ABOUT THE AUTHOR
  1078.  
  1079. FRANK DA CRUZ is Manager of Communication Software Development at Columbia
  1080. University, author of the book Kermit, A File Transfer Protocol, co-author
  1081. (with Christine M. Gianone) of the book Using C-Kermit, leader of the team
  1082. that developed the Kermit protocol, and principal author of several Kermit
  1083. software programs including C-Kermit for UNIX, VMS, and OS/2.  Present
  1084. address: Columbia University, 612 West 115th Street, New York, NY 10025, USA;
  1085. Email: fdc@columbia.edu.
  1086.  
  1087.  
  1088. REFERENCES
  1089.  
  1090.  1. ANSI X3.4-1986, Code for Information Interchange.  American National
  1091.     Standards Institute, 1986.  The ASCII specification; the US version of
  1092.     ISO 646.
  1093.  
  1094.  2. CCITT Recommendation T.61, Character Repertoire and Coded Character Sets
  1095.     for the International Teletex Service.  CCITT, Geneva, 1980 (amended
  1096.     1984).
  1097.  
  1098.  3. Chandler, John. IBM System/370 Kermit User's Guide.  Columbia University
  1099.     Academic Information Systems, 1993.  Available in separate versions for
  1100.     VM/CMS, MVS/TSO, and CICS.
  1101.  
  1102.  4. Chinese Standard GB 2312-80, Coded Chinese Graphic Character Set for
  1103.     Information Interchange.  China Association for Standardization, Beijing,
  1104.     1980.
  1105.  
  1106.  5. da Cruz, Frank.  Kermit, A File Transfer Protocol.  Digital Press,
  1107.     Bedford, MA, 1987.
  1108.  
  1109.  6. da Cruz, Frank and Christine Gianone.  Using C-Kermit.  Digital Press,
  1110.     Burlington, MA, 1993.  EY-J896E-DP, German edition available Fall 1993.
  1111.  
  1112.  7. Data General. Programming the Display Terminal: Models D217, D413, and
  1113.     D463.  Data General, Westboro, MA, 1991.  014-002111-00.
  1114.  
  1115.  8. Do, James, Ngo Thanh Nhan, Hoang Nguyen.  "A proposal for Vietnamese
  1116.     character encoding standards in a unified text processing framework".
  1117.     Computer Standards & Interfaces 14 (1992).
  1118.  
  1119.  9. Gianone, Christine M.  Using MS-DOS Kermit.  Digital Press, Burlington,
  1120.     MA, 1992.  EY-H893E-DP, Also available in French and German editions.
  1121.  
  1122. 10. Gianone, Christine M.  "Have Kermit, Will Travel".  Kermit News 3, 1
  1123.     (June 1988).
  1124.  
  1125. 11. Gianone, Christine M.  "Mission to Moscow".  Kermit News , 4 (June 1990).
  1126.  
  1127. 12. Gianone, Christine M. and Frank da Cruz.  A Locking Shift Mechanism for
  1128.     the Kermit File Transfer Protocol.  Columbia University, 1991.
  1129.  
  1130. 13. IBM Character Data Representation Architecture, Level 1 Registry.  IBM
  1131.     Canada Ltd., National Language Technical Centre, Ontario, 1990.
  1132.     SC09-1391-00.
  1133.  
  1134. 14. ISO Standard 646, 7-Bit Coded Character Set for Information Processing
  1135.     Interchange.  Second edition, International Organization for
  1136.     Standardization, 1983.  Also available as ECMA-6, and similar to CCITT
  1137.     T.50.
  1138.  
  1139. 15. ISO International Standard 2022, Information processing -- ISO 7-bit and
  1140.     8-bit coded character sets -- Code extension techniques.  Third edition,
  1141.     International Organization for Standardization, 1986.  Also available as
  1142.     ECMA-35.
  1143.  
  1144. 16. ISO International Standard ISO 2375, Information processing -- Procedure
  1145.     for Registration of Escape Sequences.  International Organization for
  1146.     Standardization, 1985.
  1147.  
  1148. 17. ISO International Standard 4873, Information processing -- ISO 8-bit code
  1149.     for information interchange -- Structure and rules for implementation.
  1150.     Second edition, International Organization for Standardization, 1986.
  1151.     Also available as ECMA-43.
  1152.  
  1153. 18. ISO International Standard 8859 Parts 1 through 9, Information
  1154.     Processing--8-Bit Single-Byte Coded Graphic Character Sets.
  1155.     International Organization for Standardization, 1987-.  ISO 8859-1
  1156.     through -4 are the Latin Alphabets 1 through 4, also available as
  1157.     ECMA-94.  ISO 8859-5 is the Latin/Cyrillic Alphabet (ECMA 113).
  1158.  
  1159. 19. ISO/IEC 10646-1, International Standard 10646, Information
  1160.     Technology--Univesral Multiple-Octet Coded Character Set (UCS).  ISO/IEC
  1161.     JTC1, 1993.
  1162.  
  1163. 20. ISO International Standard 6429, Information processing -- C1 Control
  1164.     Character Set of ISO 6429.  International Organization for
  1165.     Standardization, 1983.
  1166.  
  1167. 21. ISO International Register of Coded Characters to Be Used with Escape
  1168.     Sequences.  European Computer Manufacturers Association (ECMA), 1990,
  1169.     updated periodically.
  1170.  
  1171. 22. JIS X 0201, The Japanese Katakana and Roman Set of Characters.  Japan
  1172.     Industrial Standards Committee, 1969.
  1173.  
  1174. 23. JIS X 0208, The Japanese Graphic Character Set for Information
  1175.     Interchange.  Japan Industrial Standards Committee, 1983.
  1176.  
  1177. 24. JIS X 0212, Supplementary Japanese Graphic Character Set for Information
  1178.     Interchange.  Japan National Committee on ISO/IEC JTC1/SC2, 1991.
  1179.  
  1180. 25. Korean Standard KS C 5601-1987, Korean Graphic Character Set for
  1181.     Information Interchange.  Korea Bureau of Standards, 1987.
  1182.  
  1183. 26. Padlipsky, M. A.  The Elements of Networking Style.  Prentice Hall, 1985.
  1184.  
  1185. 27. The Unicode Consortium.  The Unicode Standard, Worldwide Character
  1186.     Encoding, Version 1.0.  Addison-Wesley Publishing Company, Volume 1,
  1187.     1991; Volume 2, 1992.
  1188.  
  1189. 28. Viet Nam General Department for Standardization. Vietnamese National
  1190.     Standard TCVN 5712, 8-bit Vietnamese Standard Code for Information
  1191.     Interchange (VSCII).  Viet Nam State Committee for Sciences, 1993.
  1192.  
  1193. (End)
  1194.