home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / charsets / cyrillic-summary.txt < prev    next >
Internet Message Format  |  2020-01-01  |  29KB

  1. From: Andras Kornai <andras@calera.com>
  2. Subject: Re: One more kermit question
  3. To: fdc@watsun.cc.columbia.edu (Frank da Cruz)
  4. Date: Thu, 11 Mar 93 21:33:45 PST
  5.  
  6. ----------------------------------------------------------------------
  7. CYRILLIC ENCODING FAQ Version 1.3, March 13 1993
  8.  
  9. ACKNOWLEDGEMENTS Most of the information was provided by the following:
  10.  
  11. David J. Birnbaum <djbpitt+@pitt.edu>
  12. Frank da Cruz <fdc@watsun.cc.columbia.edu>
  13. Bur Davis <bdavis@adobe.com>
  14. George Fowler <gfowler@ucs.indiana.edu>
  15. Richard B. Paine <RPAINE@CCNODE.Colorado.EDU>
  16. Slava Paperno <PAPY@CORNELLA.cit.cornell.edu>
  17. Keld J. Simonsen <Keld.Simonsen@dkuug.dk>
  18. Glenn E. Thobe <thobe@getunx.info.com>
  19. Dimitri Vulis <DLV@CUNYVMS1.BITNET>
  20. Johan W. van Wingen <precal@rulmvs.leidenuniv.nl>
  21.  
  22.  
  23. Thanks to all who contributed -- I am responsible for the errors that
  24. still remain. 
  25.  
  26. Andras Kornai (andras@calera.com, kornai@csli.stanford.edu)
  27.  
  28.  
  29. Q: What are the commonly used computer encodings for Cyrillic?  
  30. A: Broadly speaking, there are three kinds of schemes in use: those that
  31. replace Cyrillic characters by 7-bit ascii values, those that use the
  32. full 8-bit range 0-255, and those using multi-byte codes.  Presently
  33. only the first two types are in wide use, but for reference purposes I
  34. will also discuss the third type.
  35.  
  36.  
  37. Q: What kind of transliteration schemes are there?  
  38. A: The most important one is called KOI-7: the Russian alphabet is given
  39. by the ASCII characters (note the exchange of upper and lower cases):
  40.  
  41. UPPER CASE:  abwgde$vzijklmnoprstufhc~{}"yx|`q
  42. lower case:  ABWGDE#VZIJKLMNOPRSTUFHC^[]_YX\@Q
  43.  
  44. The following extensions to the official standard KOI-7 are supported in
  45. Glenn Thobe's conversion programs for invertibility: '"'=YER, '#'=yo,
  46. '$'=YO, '<'=left guillemet, '>'=right guillemet.
  47.  
  48. A slightly different (multicharacter) scheme is employed by Steve
  49. Gaardner's (gaarder@theory.tc.cornell.edu) conversion code from Old
  50. KOI-8, included below. This particular scheme provides easy
  51. readability but suffers from some transliteration weirdness, such as
  52. mapping short ii and yeri on the same character. Since proper
  53. transliteration often requires context-sensitive rules, and differs
  54. from language to language within the same script, a fuller discussion
  55. is beyond the scope of the present document. For an overview of the
  56. major Cyrillic to Latin transliteration schemes used in the US, see pp
  57. 457-460 of the Style Manual of the US Government Printing Office, for
  58. sale by the Superintendent of Documents, USGPO, Washington DC 20402,
  59. Stock Number 021-000-00120-1 (paper) or 021-000-00120-0 (hardbound).
  60. See also the Chicago Manual of Style, and Transliteracija russkikh
  61. slov latinskimi bukvami, GOST 167876-71
  62.  
  63.  
  64. #include <stdio.h>
  65. char transtbl[64][5] =
  66.         {"yu", "a", "b", "ts", "d" , "e", "f", "g", "kh", "i", "y" , "k", "l",
  67.         "m", "n", "o", "p", "ya", "r" , "s", "t", "u", "zh", "v", "'",
  68.         "y", "z", "sh", "e", "shch", "ch", "`", 
  69.         "YU", "A", "B", "TS", "D" , "E", "F", "G", "KH", "I", "Y" , "K", "L",
  70.         "M", "N", "O", "P", "YA", "R" , "S", "T", "U", "ZH", "V", "'",
  71.         "Y", "Z", "SH", "E", "SHCH", "CH", "`" };
  72. main()
  73. {
  74.         int c;
  75.  
  76.         while ((c = getchar()) != EOF)
  77.         {       if ( c > 0x80) c -= 0x80;
  78.                 if ( c < 0x40) putchar(c);
  79.                 else printf("%s",transtbl[c-0x40]);
  80.         }
  81. }
  82.  
  83.  
  84. Q: What are the eight-bit schemes?  
  85.  
  86. A: For the IBM mainframe world, which includes the ES (edinnaja sistema)
  87. clones of 360-370 mainframes, the basic scheme, called DKOI-8, extends
  88. EBCDIC by putting the Cyrillic letters in the unused slots, mostly in
  89. the rectangle 0x8a to 0xff (first hex digit >=8, second digit >=a). The
  90. mysteries of EBCDIC/ASCII conversion go beyond the scope of this
  91. document, and in the table that follows I will ignore 8-bit ascii values
  92. below 0xa0 and refer the reader to Dimitri Vulis' excellent document,
  93. which sheds some light on the IBM meaning of the characters 0x80-0x9f
  94. which are reserved in both IS0 8859-1 (Latin-1) and 8859-5 (Cyrillic).
  95.  
  96. /* From 8859-5 to DKOI-8. ebcdic(isoval) = isotoibm[isoval-160] */
  97.  
  98. int isotoibm[96] = {
  99. 0x41,0xaa,0x4a,0xb1,0x9f,0xb2,0x6a,0xb5,
  100. 0xbd,0xb4,0x9a,0x8a,0x5f,0xca,0xaf,0xbc,
  101. 0x90,0x8f,0xea,0xfa,0xbe,0xa0,0xb6,0xb3,
  102. 0x9d,0xda,0x9b,0x8b,0xb7,0xb8,0xb9,0xab,
  103. 0x64,0x65,0x62,0x66,0x63,0x67,0x9e,0x68,
  104. 0x74,0x71,0x72,0x73,0x78,0x75,0x76,0x77,
  105. 0xac,0x69,0xed,0xee,0xeb,0xef,0xec,0xbf,
  106. 0x80,0xfd,0xfe,0xfb,0xfc,0xad,0xae,0x59,
  107. 0x44,0x45,0x42,0x46,0x43,0x47,0x9c,0x48,
  108. 0x54,0x51,0x52,0x53,0x58,0x55,0x56,0x57,
  109. 0x8c,0x49,0xcd,0xce,0xcb,0xcf,0xcc,0xe1,
  110. 0x70,0xdd,0xde,0xdb,0xdc,0x8d,0x8e,0xdf
  111. };
  112.  
  113. There are minor variations to DKOI, called Cyrillic Extended Code Page
  114. 037 (most common on BITNET), CECP 500 (which is the definitive one), the
  115. "JNET" and the "FORTRAN" mappings. The differences between these are
  116. tabulated below. Notice that EBCDIC/DKOI, unlike ASCII, is not uniquely
  117. defined even on the 0-127 range:
  118.  
  119.  
  120. 8859-5 037 500 JNET FORTRAN
  121.  
  122. 0x21 0x5a 0x4f 0x5a 0x4f exclamation point (bang)
  123. 0x5b 0xba 0x4a 0xad 0x4a opening square bracket
  124. 0x5d 0xbb 0x5a 0xbd 0x5a closing square bracket
  125. 0x5e 0xb0 0x5f 0x5f 0x5f circumflex accent
  126. 0x7c 0x4f 0xbb 0x6a 0x4f logical or (vertical bar)
  127. [a2] 0x4a 0xb0 0x43 0x43 centsign (in 037)/capital dje (in 500)
  128. [ac] 0x5f 0xba 0x54 0x54 logical not (in 037)/capital kje (in 500)
  129. 0xd5 0xef 0xef 0xbb 0xad small ie 
  130. 0xe3 0x46 0x46 0x4a 0xbb small u
  131. 0xe5 0x47 0x47 0xfc 0xbd small kha
  132. 0xfc 0xdc 0xdc 0x6a 0xfc small kje 
  133.  
  134.  
  135.  
  136.  
  137. For the Internet, the most important code seems to be Old KOI-8, widely used
  138. in the Relcom groups (but probably not a whole lot elsewhere). Old KOI-8
  139. (GOST 19768-74) from 1974 more or less follows Latin transliteration order
  140. and does not include upper-case hard sign, or letters common to other Slavic
  141. Cyrillic alphabets (Bulgarian, Macedonian, Serbian, Ukrainian...).  In the
  142. 0-127 range it is identical with ascii, and for the 192-254 region see the
  143. transtabl array above.  Some software, including uunpack (also used in
  144. Sergej Ryzhkov's bml, aka Beauty Mail system for PCs) which is distributed
  145. by Relcom, force upper-case hard sign to 255, others (and the standard!)
  146. declare this incorrect, or perhaps reserve 255 for DEL.  In an earlier
  147. version of Andrew Hume's <andrew@research.att.com> tcs, which supports
  148. conversion across a wide variety of Cyrillic encodings, this was called the
  149. "mystery DOS Cyrillic encoding", except that his sha and shcha seem to be
  150. interchanged. Tcs is available for anon ftp from research.att.com in
  151. directory /dist/tcs.shar.Z. The semantics of 128-191 in Old KOI is unclear
  152. to me. If there is an official code page (it was suggested that Xenix users
  153. might have one), please post it.
  154.  
  155. For the PC community, Code Page 866 seems to be quite important. This is
  156. what Microsoft is using in its russified version of MS-DOS. In 0-31
  157. ascii control chars are replaced by a random selection of dingbats. In
  158. 32-126 it is identical to ascii, and in 127 it has something that looks
  159. like a little house (the interpretation of such positions seems to be
  160. subject to much uncertainty). The Russian part (128-255) is identical to
  161. Brjabrin's alternativnyj variant, except for 242-251, where some of the
  162. accents/symbols of AV are replaced by non-Russian Cyrillic characters
  163. and other symbols. Unfortunately CP 866 covers only Ukrainian and
  164. Belorussian, with the vague suggestion that e.g.  Macedonian users could
  165. redefine the six non-Russian Cyrillic positions.  This problem is
  166. largely resolved in Code Page 1251, the Microsoft Cyrillic Windows 3.1
  167. character set, (also endorsed by WordPerfect and Adobe), which contains
  168. all Cyrillic letters used by modern Slavic languages. CP 1251 is fully
  169. compatible with ascii on 0-127 (leaves control positions undefined), has
  170. the Russian alphabet (in order, but without io) in 192-256, and puts the
  171. non-Russian Cyrillic, Russian io, and a few symbols in 128-191.
  172.  
  173. Brjabrin's Alternativnyj Variant (AV) is also widely used on PCs.  It
  174. has Russian in 128 to 175 in alphabetical order except for yo, graphics
  175. characters in 176 to 223, again Russian in 224-241. The same set of
  176. graphics characters, but not in the same order, is used in Brajabin's
  177. Osnovnoj Variant: they are similar to, but not identical with, IBM
  178. Extended ASCII graphics chars (neither the set of shapes nor the code
  179. values are the exact same). AV and OV have no non-Russian Cyrillic or
  180. accented characters, but four accent marks are provided: 242 (acute
  181. below the symbol), 243 (grave below the symbol), 244 (acute above the
  182. symbol), and 245 (grave above the symbol). These, as well as upper case
  183. and lower case yo, codes 240 and 241, are in the same position in
  184. Osnovnoj Variant as well. Codes 246 - 249 are arrows, pointing right,
  185. left, down, up, in that order.  Codes 250 and 251 are, in both sets
  186. described by Briabrin, the division sign and the plus/minus sign (the
  187. latter becomes a radical sign in 866). 252 is the Number symbol, 253 is
  188. a sunburst, and 254 is "end of proof". 255 is in principle unused -- in
  189. practice people put things there.
  190.  
  191. For the academic community, the lack of accents is remedied by the
  192. Academic version of AV developed at Cornell, which includes upper and
  193. lower case acute-accented vowels, and lower case grave-accented vowels.
  194. These replace all but six of the graphics characters (the six that were
  195. retained are those that are necessary for drawing a single-line box).
  196. The accented vowels in this set include a grave-accented lower case yo.
  197. Also included are the letters with diacritics used in French, German,
  198. and Spanish. The complete chart and DOS/Windows software may be
  199. requested from Exceller Software Corp.  800-426-0444. (This is NOT a
  200. product endorsement -- I haven't even seen the stuff!) Cornell also
  201. developed an Academic version of CP1251.  In this, non-Russian Slavic
  202. languages are not supported: their letters have been replaced by Russian
  203. accented vowels.  These include upper and lower case acute-accented
  204. vowels, and lower case grave-accented vowels. Also included are upper
  205. and lower case grave-accented yo. The AcademicFont Cyrillic character
  206. set was developed by University Microcomputers, who pioneered the use of
  207. Slavic languages on IBM-compatible computers in the US in the
  208. mid-eighties. This set is included among the 11 sets in Exceller's
  209. product. It supports Slavic and some non-Slavic languages, but not
  210. accented vowels.
  211.  
  212. For the Macintosh community, there is a separate code page. It is ascii
  213. below 128, has the Russian capital letters in 128-159 in alphabetical order
  214. (as usual, io is treated separately) and the Russian lowercase letters in
  215. 240-254, but lower case ja is moved to 239, its place taken by the sunburst
  216. symbol. In the 160-238 range we finde the same set of (ISO 8859-5)
  217. non-Russian Cyrillic characters as in CP 1251. The symbols that appear here
  218. are also largely the same as in 1251, but the orderings are completely
  219. different and a few symbols are unique to one or the other, e.g.  permille
  220. in 1251, capital delta in the Mac encoding.  While a Macintosh version
  221. capable of character conversion is still on the drawing boards, for most
  222. other platforms Columbia Kermit is capable of converting between a large
  223. variety of Cyrilic encodings.  Anon ftp to watsun.cc.columbia.edu: for
  224. C-Kermit 5A(188) (Unix, VMS, OS/2, Amiga etc) get file kermit/b/ckaaaa.hlp,
  225. read it, take it from there. For MS-DOS Kermit 3.11, get (in binary mode)
  226. kermit/bin/msvibm.zip, then unzip. For IBM Mainframe Kermit 4.2 and later,
  227. get kermit/b/ik0*.* plus one of the following: kermit/b/ikc*.* for VM/CMS,
  228. kermit/b/ikt*.* for MVS, kermit/b/ikx*.* for CICS or kermit/b/ikm*.* for
  229. MUSIC. There is also a large collection of character-set tables under
  230. kermit/charsets.
  231.  
  232. Finally, the most broadly accepted standard outside these communities seems
  233. to be GOSTSCI (GOSTCII), a term used colloquially to refer to Brjabrin's
  234. Osnovnoj Variant or to ISO 8859-5 (which is also ECMA 113), although these
  235. two are not identical when it comes to non-Russian Cyrillic. The term "New
  236. KOI-8" means the 1987 revision of KOI-8 (GOST 19768-87) -- all these use the
  237. same (alphabetical, except for yo) order as 8859/5, starting with A at 176.
  238. However, the non-Russian Cyrillic characters (160-176 and 240-255 in new
  239. KOI-8) are not part of OV, their space is taken up by some graphics chars
  240. described for AV above. ISO 8859-5 provides for the Cyrillic characters
  241. required for writing all major Slavic Cyrillic alphabets (Belorussian,
  242. Bulgarian, Macedonian, Serbian, Ukrainian...), but not for those alphabets
  243. that were devised for non-Slavic languages in the Soviet Union (Abkhazian,
  244. Bashkir, Chukchee, Khanty, Tajik, ....), or archaic letters.
  245.  
  246.  
  247. Q: Is this a big mess or what?
  248. A: To straighten this out, it seems necessary to adopt a fixed point of
  249. reference, which I take to be Unicode V1.1 = ISO 10646-1.2. While in
  250. principle 10646 is a four-byte standard and Unicode uses 16-bit integers,
  251. the "Basic Multilingual Plane" of 10646 is by definition identical to the
  252. values assigned in Unicode 1.1, both being two-byte quantities (called UCS-2
  253. by ISO). The following list gives the essential part of the names of the
  254. Cyrillic characters and the last two hex digits of their Unicode/10646
  255. encoding.
  256.  
  257. For reasons of space, the official Unicode/10646 names have been
  258. abbreviated. For a full list of names, anon ftp to unicode.org, cd to
  259. pub/MappingTables, and get namesall.lst (which is slightly over 200k).  To
  260. get back the full official name from the abbreviations, always add the
  261. prefix CYRILLIC, unless the position is UNUSED. Further, expand CAP (SMA) to
  262. CAPITAL (SMALL). Finally, the word LETTER should be added after CAP/SMA,
  263. unless it is THOUSANDS, LIGATURE, or COMBINING.  The numerical code values
  264. given in the second column have also been abbreviated to the last two
  265. digits, since the preceding two hex digits (really signifying "Cyrillic")
  266. are always 04 in Unicode/10646.
  267.  
  268. The third column gives the-two character mnemonic abbreviations suggested in
  269. Keld Simonsen's RFC1345 where they exist, to facilitate cross-reference to
  270. this document (available by anon ftp e.g. from sunsite.unc.edu as
  271. /pub/doc/rfp/rfp1345.txt.Z) which has tables for Serbian, Macedonian, as
  272. well as other Cyrillic encodings (IBM CP 880, INIS-cyrillic = ISO-IR-51,
  273. ECMA-cyrillic = ISO-IR-111) whose domain of usage is unclear to me, and
  274. whose table for Old KOI seems to be in fact a New KOI table. I will add
  275. conversion tables for these (or for any other) encodings provided a real
  276. user community exists and actually generates some public domain
  277. machine-readable texts.
  278.  
  279. UNUSED                00
  280. CAP IO                01  IO
  281. CAP DJE                02  D%
  282. CAP GJE                03  G%
  283. CAP E                04  IE
  284. CAP DZE                05  DS
  285. CAP I                06  II
  286. CAP YI                07  YI
  287. CAP JE                08  J%
  288. CAP LJE                09  LJ
  289. CAP NJE                0A  NJ
  290. CAP TSHE            0B  Ts
  291. CAP KJE                0C  KJ
  292. UNUSED                0D
  293. CAP SHORT U            0E  V%
  294. CAP DZHE            0F  DZ
  295. CAP A                10  A=
  296. CAP BE                11  B=
  297. CAP VE                12  V=
  298. CAP GE                13  G=
  299. CAP DE                14  D=
  300. CAP IE                15  E=
  301. CAP ZHE                16  Z%
  302. CAP ZE                17  Z=
  303. CAP II                18  I=
  304. CAP SHORT II            19  J=
  305. CAP KA                1A  K=
  306. CAP EL                1B  L=
  307. CAP EM                1C  M=
  308. CAP EN                1D  N=
  309. CAP O                1E  O=
  310. CAP PE                1F  P=
  311. CAP ER                20  R=
  312. CAP ES                21  S=
  313. CAP TE                22  T=
  314. CAP U                23  U=
  315. CAP EF                24  F=
  316. CAP KHA                25  H=
  317. CAP TSE                26  C=
  318. CAP CHE                27  C%
  319. CAP SHA                28  S%
  320. CAP SHCHA            29  Sc
  321. CAP HARD SIGN            2A  ="
  322. CAP YERI            2B  Y=
  323. CAP SOFT SIGN            2C  %"
  324. CAP REVERSED E            2D  JE
  325. CAP IU                2E  JU
  326. CAP IA                2F  JA
  327. SMA A                30  a=
  328. SMA BE                31  b=
  329. SMA VE                32  v=
  330. SMA GE                33  g=
  331. SMA DE                34  d=
  332. SMA IE                35  e=
  333. SMA ZHE                36  z%
  334. SMA ZE                37  z=
  335. SMA II                38  i=
  336. SMA SHORT II            39  j=
  337. SMA KA                3A  k=
  338. SMA EL                3B  l=
  339. SMA EM                3C  m=
  340. SMA EN                3D  n=
  341. SMA O                3E  o=
  342. SMA PE                3F  p=
  343. SMA ER                40  r=
  344. SMA ES                41  s=
  345. SMA TE                42  t=
  346. SMA U                43  u=
  347. SMA EF                44  f=
  348. SMA KHA                45  h=
  349. SMA TSE                46  c=
  350. SMA CHE                47  c%
  351. SMA SHA                48  s%
  352. SMA SHCHA            49  sc
  353. SMA HARD SIGN            4A  ='
  354. SMA YERI            4B  y=
  355. SMA SOFT SIGN            4C  %'
  356. SMA REVERSED E            4D  je
  357. SMA IU                4E  ju
  358. SMA IA                4F  ja
  359. UNUSED                50   
  360. SMA IO                51  io
  361. SMA DJE                52  d%
  362. SMA GJE                53  g%
  363. SMA E                54  ie
  364. SMA DZE                55  ds
  365. SMA I                56  ii
  366. SMA YI                57  yi
  367. SMA JE                58  j%
  368. SMA LJE                59  lj
  369. SMA NJE                5A  nj
  370. SMA TSHE            5B  ts
  371. SMA KJE                5C  kj
  372. UNUSED                5D
  373. SMA SHORT U            5E  v%
  374. SMA DZHE            5F  dz
  375. CAP OMEGA            60
  376. SMA OMEGA            61
  377. CAP YAT                62  Y3
  378. SMA YAT                63  y3
  379. CAP IOTIFIED E            64
  380. SMA IOTIFIED E            65
  381. CAP LITTLE YUS            66
  382. SMA LITTLE YUS            67
  383. CAP IOTIFIED LITTLE YUS        68
  384. SMA IOTIFIED LITTLE YUS        69
  385. CAP BIG YUS            6A  O3
  386. SMA BIG YUS            6B  o3
  387. CAP IOTIFIED BIG YUS        6C
  388. SMA IOTIFIED BIG YUS        6D
  389. CAP KSI                6E
  390. SMA KSI                6F
  391. CAP PSI                70
  392. SMA PSI                71
  393. CAP FITA            72  F3
  394. SMA FITA            73  f3
  395. CAP IZHITSA            74  V3
  396. SMA IZHITSA            75  v3
  397. CAP IZHITSA DOUBLE GRAVE    76
  398. SMA IZHITSA DOUBLE GRAVE    77
  399. CAP UK DIGRAPH            78
  400. SMA UK DIGRAPH            79
  401. CAP ROUND OMEGA            7A
  402. SMA ROUND OMEGA            7B
  403. CAP OMEGA TITLO            7C
  404. SMA OMEGA TITLO            7D
  405. CAP OT                7E
  406. SMA OT                7F
  407. CAP KOPPA            80  C3
  408. SMA KOPPA            81  c3
  409. THOUSANDS SIGN            82
  410. NON-SPACING TITLO        83
  411. NON-SPACING PALATALIZATION    84
  412. NON-SPACING DASIA PNEUMATA    85 
  413. NON-SPACING PSILI PNEUMATA    86 
  414. UNUSED                87
  415. UNUSED                88
  416. UNUSED                89
  417. UNUSED                8A
  418. UNUSED                8B
  419. UNUSED                8C
  420. UNUSED                8D
  421. UNUSED                8E
  422. UNUSED                8F
  423. CAP GE WITH UPTURN        90  G3
  424. SMA GE WITH UPTURN        91  g3
  425. CAP GE BAR            92
  426. SMA GE BAR            93
  427. CAP GE HOOK            94
  428. SMA GE HOOK            95
  429. CAP ZHE WITH RIGHT DESCENDER    96
  430. SMA ZHE WITH RIGHT DESCENDER    97
  431. CAP ZE CEDILLA            98
  432. SMA ZE CEDILLA            99
  433. CAP KA WITH RIGHT DESCENDER    9A
  434. SMA KA WITH RIGHT DESCENDER    9B
  435. CAP KA VERTICAL BAR        9C
  436. SMA KA VERTICAL BAR        9D
  437. CAP KA BAR            9E
  438. SMA KA BAR            9F
  439. CAP REVERSED GE KA        A0
  440. SMA REVERSED GE KA        A1
  441. CAP EN WITH RIGHT DESCENDER    A2
  442. SMA EN WITH RIGHT DESCENDER    A3
  443. CAP EN GE            A4
  444. SMA EN GE            A5
  445. CAP PE HOOK            A6
  446. SMA PE HOOK            A7
  447. CAP O HOOK            A8
  448. SMA O HOOK            A9
  449. CAP ES CEDILLA            AA
  450. SMA ES CEDILLA            AB
  451. CAP TE WITH RIGHT DESCENDER    AC
  452. SMA TE WITH RIGHT DESCENDER    AD
  453. CAP STRAIGHT U            AE
  454. SMA STRAIGHT U            AF
  455. CAP STRAIGHT U BAR        B0
  456. SMA STRAIGHT U BAR        B1
  457. CAP KHA WITH RIGHT DESCENDER    B2
  458. SMA KHA WITH RIGHT DESCENDER    B3
  459. CAP TE TSE            B4
  460. SMA TE TSE            B5
  461. CAP CHE WITH RIGHT DESCENDER    B6
  462. SMA CHE WITH RIGHT DESCENDER    B7
  463. CAP CHE VERTICAL BAR        B8
  464. SMA CHE VERTICAL BAR        B9
  465. CAP H                BA
  466. SMA H                BB
  467. CAP IE HOOK            BC
  468. SMA IE HOOK            BD
  469. CAP IE HOOK OGONEK        BE
  470. SMA IE HOOK OGONEK        BF
  471. PALOCHKA            C0
  472. CAP SHORT ZHE            C1
  473. SMA SHORT ZHE            C2
  474. CAP KA HOOK            C3
  475. SMA KA HOOK            C4
  476. UNUSED                C5
  477. UNUSED                C6
  478. CAP EN HOOK            C7
  479. SMA EN HOOK            C8
  480. UNUSED                C9
  481. UNUSED                CA
  482. CAP CHE WITH LEFT DESCENDER    CB
  483. SMA CHE WITH LEFT DESCENDER    CC
  484. UNUSED                CD
  485. UNUSED                CE
  486. UNUSED                CF
  487. CAP A WITH BREVE        D0
  488. SMA A WITH BREVE        D1
  489. CAP A WITH DIAERESIS        D2
  490. SMA A WITH DIAERESIS        D3
  491. CAP LIGATURE A IE        D4
  492. SMA LIGATURE A IE        D5
  493. CAP IE WITH BREVE        D6
  494. SMA IE WITH BREVE        D7
  495. CAP SCHWA            D8
  496. SMA SCHWA            D9
  497. CAP SCHWA WITH DIAERESIS    DA
  498. SMA SCHWA WITH DIAERESIS    DB
  499. CAP ZHE WITH DIAERESIS        DC
  500. SMA ZHE WITH DIAERESIS        DD
  501. CAP ZE WITH DIAERESIS        DE
  502. SMA ZE WITH DIAERESIS        DF
  503. CAP ABKHASIAN DZE        E0
  504. SMA ABKHASIAN DZE        E1
  505. CAP I WITH MACRON        E2
  506. SMA I WITH MACRON        E3
  507. CAP I WITH DIAERESIS        E4
  508. SMA I WITH DIAERESIS        E5
  509. CAP O WITH DIAERESIS        E6
  510. SMA O WITH DIAERESIS        E7
  511. CAP BARRED O            E8
  512. SMA BARRED O            E9
  513. CAP BARRED O WITH DIAERESIS    EA
  514. SMA BARRED O WITH DIAERESIS    EB
  515. CAP U WITH ACUTE        EC
  516. SMA U WITH ACUTE        ED
  517. CAP U WITH MACRON        EE
  518. SMA U WITH MACRON        EF
  519. CAP U WITH DIAERESIS        F0
  520. SMA U WITH DIAERESIS        F1
  521. CAP U WITH DOUBLE ACUTE        F2
  522. SMA U WITH DOUBLE ACUTE        F3
  523. CAP CHE WITH DIAERESIS        F4
  524. SMA CHE WITH DIAERESIS        F5
  525. CAP DJE WITH ACUTE        F6
  526. SMA DJE WITH ACUTE        F7
  527. CAP YERU WITH DIAERESIS        F8
  528. SMA YERU WITH DIAERESIS        F9
  529. UNUSED                FA
  530. UNUSED                FB
  531. UNUSED                FC
  532. UNUSED                FD
  533. UNUSED                FE
  534. UNUSED                FF
  535.  
  536.  
  537.  
  538. Q: Is everything clear now? 
  539.  
  540. A: Probably not. To ease the pain, here follow some tentative conversion
  541. tables *from* the 8-bit schemes described above *to* Unicode. Since the
  542. Unicode/10646 character set is much larger, no tables are provided in
  543. the other direction.
  544.  
  545. In the 0-127 range everything is ASCII (except for the CP866 dingbats in
  546. the range 0-31 which are at any rate optional, and for EBCDIC/DKOI-8, for
  547. which see above) so here tables are only provided for 128-255. Notice
  548. that often values other than starting with 0x04 are given, meaning that
  549. the Unicode equivalent is outside the Unicode Cyrillic range
  550. 0x0400-0x04ff, but included at some other place, typically among the
  551. arrows (0x2190-0x21ff) or other semigraphic material (0x2500-0x25ff). If
  552. a particular encoding leaves (by official definition, not necessarily in
  553. practical usage) some code unused, this is designated by "-1" in the
  554. conversion table. For some positions the tables show a "-2", meaning
  555. that I have no information on the intended meaning.  (This is not the
  556. same as there being no Unicode codepoint for the character in question,
  557. a situation we potentially encounter with AV and OV 242-245, see note
  558. there.)
  559.  
  560.  
  561.  
  562. /* From old Koi-8 to Unicode */
  563.  
  564. long oldkoi8tou[128] = {
  565. -2, -2, -2, -2, -2, -2, -2, -2,
  566. -2, -2, -2, -2, -2, -2, -2, -2,
  567. -2, -2, -2, -2, -2, -2, -2, -2,
  568. -2, -2, -2, -2, -2, -2, -2, -2,
  569. -2, -2, -2, -2, -2, -2, -2, -2,
  570. -2, -2, -2, -2, -2, -2, -2, -2,
  571. -2, -2, -2, -2, -2, -2, -2, -2,
  572. -2, -2, -2, -2, -2, -2, -2, -2,
  573. 0x044e,0x0430,0x0431,0x0446,0x0434,0x0435,0x0444,0x0433,
  574. 0x0445,0x0438,0x0439,0x043a,0x043b,0x043c,0x043d,0x043e,
  575. 0x043f,0x044f,0x0440,0x0441,0x0442,0x0443,0x0436,0x0432,
  576. 0x044c,0x044b,0x0437,0x0448,0x044d,0x0449,0x0447,0x044a,
  577. 0x042e,0x0410,0x0411,0x0426,0x0414,0x0415,0x0424,0x0413,
  578. 0x0425,0x0418,0x0419,0x041a,0x041b,0x041c,0x041d,0x041e,
  579. 0x041f,0x042f,0x0420,0x0421,0x0422,0x0423,0x0416,0x0412,
  580. 0x042c,0x042b,0x0417,0x0428,0x042d,0x0429,0x0427,0x042a
  581. };
  582.  
  583.  
  584. /* From CP866 to Unicode */
  585.  
  586. long cp866tou[128] = {
  587. 0x0410,0x0411,0x0412,0x0413,0x0414,0x0415,0x0416,0x0417,
  588. 0x0418,0x0419,0x041a,0x041b,0x041c,0x041d,0x041e,0x041f,
  589. 0x0420,0x0421,0x0422,0x0423,0x0424,0x0425,0x0426,0x0427,
  590. 0x0428,0x0429,0x042a,0x042b,0x042c,0x042d,0x042e,0x042f,
  591. 0x0430,0x0431,0x0432,0x0433,0x0434,0x0435,0x0436,0x0437,
  592. 0x0438,0x0439,0x043a,0x043b,0x043c,0x043d,0x043e,0x043f,
  593. 0x2591,0x2592,0x2593,0x2502,0x2524,0x2561,0x2562,0x2556,
  594. 0x2555,0x2563,0x2551,0x2557,0x255d,0x255c,0x255b,0x2510,
  595. 0x2514,0x2534,0x252c,0x251c,0x2500,0x253c,0x255e,0x255f,
  596. 0x255a,0x2554,0x2569,0x2566,0x2560,0x2550,0x256c,0x2567,
  597. 0x2568,0x2564,0x2565,0x2559,0x2558,0x2552,0x2553,0x256b,
  598. 0x256a,0x2518,0x250c,0x2588,0x2584,0x258c,0x2590,0x2580,
  599. 0x0440,0x0441,0x0442,0x0443,0x0444,0x0445,0x0446,0x0447,
  600. 0x0448,0x0449,0x044a,0x044b,0x044c,0x044d,0x044e,0x044f,
  601. 0x0401,0x0451,0x0404,0x0454,0x0407,0x0457,0x040e,0x045e,
  602. 0x00b0,0x2022,0x00b7,0x221a,0x2116,0x00a4,0x25a0,   -1
  603. };
  604.  
  605.  
  606. /* From CP1251 to Unicode */
  607.  
  608. long cp1251tou[128] = {
  609. 0x0402,0x0403,0x201a,0x0453,0x201e,0x2026,0x2020,0x2021,
  610.     -1,0x2030,0x0409,0x2039,0x040a,0x040c,0x040b,0x040f,
  611. 0x0452,0x2018,0x2019,0x201c,0x201d,0x2022,0x2013,0x2014,
  612.     -1,0x2122,0x0459,0x203a,0x045a,0x045c,0x045b,0x045f,
  613. 0x00a0,0x040e,0x045e,0x0408,0x00a4,0x0490,0x00a6,0x00a7,
  614. 0x0401,0x00a9,0x0404,0x00ab,0x00ac,0x00ad,0x00ae,0x0407,
  615. 0x00b0,0x00b1,0x0406,0x0456,0x0491,0x00b5,0x00b6,0x00b7,
  616. 0x0451,0x2116,0x0454,0x00bb,0x0458,0x0405,0x0455,0x0457,
  617. 0x0410,0x0411,0x0412,0x0413,0x0414,0x0415,0x0416,0x0417,
  618. 0x0418,0x0419,0x041a,0x041b,0x041c,0x041d,0x041e,0x041f,
  619. 0x0420,0x0421,0x0422,0x0423,0x0424,0x0425,0x0426,0x0427,
  620. 0x0428,0x0429,0x042a,0x042b,0x042c,0x042d,0x042e,0x042f,
  621. 0x0430,0x0431,0x0432,0x0433,0x0434,0x0435,0x0436,0x0437,
  622. 0x0438,0x0439,0x043a,0x043b,0x043c,0x043d,0x043e,0x043f,
  623. 0x0440,0x0441,0x0442,0x0443,0x0444,0x0445,0x0446,0x0447,
  624. 0x0448,0x0449,0x044a,0x044b,0x044c,0x044d,0x044e,0x044f,
  625. };
  626.  
  627.  
  628. /* From Mac to Unicode */
  629.  
  630. long mactou[128] = {
  631. 0x0410,0x0411,0x0412,0x0413,0x0414,0x0415,0x0416,0x0417,
  632. 0x0418,0x0419,0x041a,0x041b,0x041c,0x041d,0x041e,0x041f,
  633. 0x0420,0x0421,0x0422,0x0423,0x0424,0x0425,0x0426,0x0427,
  634. 0x0428,0x0429,0x042a,0x042b,0x042c,0x042d,0x042e,0x042f,
  635. 0x2020,0x00b0,0x0490,0x00a3,0x00a7,0x2022,0x00b6,0x0406,
  636. 0x00ae,0x00a9,0x2122,0x0402,0x0452,0x2260,0x0403,0x0453,
  637. 0x221e,0x00b1,0x2264,0x2265,0x0456,0x03bc,0x0491,0x0408,
  638. 0x0404,0x0454,0x0407,0x0457,0x0409,0x0459,0x040a,0x045a,
  639. 0x0458,0x0405,0x00ac,0x221a,0x0192,0x2248,0x0394,0x00ab,
  640. 0x00bb,0x2026,0x0020,0x040b,0x045b,0x040c,0x045c,0x0455,
  641. 0x00b0,0x00b1,0x0406,0x0456,0x0491,0x00b5,0x00b6,0x00b7,
  642. 0x040e,0x045e,0x040f,0x045f,0x2116,0x0401,0x0451,0x044f,
  643. 0x0430,0x0431,0x0432,0x0433,0x0434,0x0435,0x0436,0x0437,
  644. 0x0438,0x0439,0x043a,0x043b,0x043c,0x043d,0x043e,0x043f,
  645. 0x0440,0x0441,0x0442,0x0443,0x0444,0x0445,0x0446,0x0447,
  646. 0x0448,0x0449,0x044a,0x044b,0x044c,0x044d,0x044e,0x00a4,
  647. };
  648.  
  649.  
  650. /* From Alternativnyj Variant to Unicode */
  651.  
  652. long avtou[128] = {
  653. 0x0410,0x0411,0x0412,0x0413,0x0414,0x0415,0x0416,0x0417,
  654. 0x0418,0x0419,0x041a,0x041b,0x041c,0x041d,0x041e,0x041f,
  655. 0x0420,0x0421,0x0422,0x0423,0x0424,0x0425,0x0426,0x0427,
  656. 0x0428,0x0429,0x042a,0x042b,0x042c,0x042d,0x042e,0x042f,
  657. 0x0430,0x0431,0x0432,0x0433,0x0434,0x0435,0x0436,0x0437,
  658. 0x0438,0x0439,0x043a,0x043b,0x043c,0x043d,0x043e,0x043f,
  659. 0x2591,0x2592,0x2593,0x2502,0x2524,0x2561,0x2562,0x2556,
  660. 0x2555,0x2563,0x2551,0x2557,0x255d,0x255c,0x255b,0x2510,
  661. 0x2514,0x2534,0x252c,0x251c,0x2500,0x253c,0x255e,0x255f,
  662. 0x255a,0x2554,0x2569,0x2566,0x2560,0x2550,0x256c,0x2567,
  663. 0x2568,0x2564,0x2565,0x2559,0x2558,0x2552,0x2553,0x256b,
  664. 0x256a,0x2518,0x250c,0x2588,0x2584,0x258c,0x2590,0x2580,
  665. 0x0440,0x0441,0x0442,0x0443,0x0444,0x0445,0x0446,0x0447,
  666. 0x0448,0x0449,0x044a,0x044b,0x044c,0x044d,0x044e,0x044f,
  667. 0x0401,0x0451,0x0317,0x0316,0x0301,0x0300,0x2192,0x2190,
  668. 0x2193,0x2191,0x00f7,0x00b1,0x2116,0x00a4,0x25a0,   -1
  669. };
  670.  
  671. /* The interpretation of the four symbols following the second
  672. alphabetic block in AV remains unclear. One suggestion was to treat
  673. these as (non-spacing) grave and acute, as appearing above upper- or
  674. lowercase letters, but the graphical rendering in Briabin's original
  675. article makes clear that the distinction is between acute and grave,
  676. above or below the letter: this is what the table now has.
  677.  
  678. But the preponderance of graphical symbols in AV suggests that the
  679. intention was to provide facilities for character graphics, in which
  680. case the interpretation is simply straight lines connecting two
  681. adjacent midpoints of the bounding box.  If the box is the unit
  682. square, these would run from (.5,0) to (0,.5) and to (1,.5), and from
  683. (.5,1) to (0,.5) and to (1,.5), in this order. (The line segments are
  684. of course directionless.) Such symbols are not present in Unicode --
  685. the closest things are 0x25de 0x25df 0x25dc 0x25dd (in this order) but
  686. these are curved, not straight.
  687.  
  688. Whether the graphics or the accent usage is more prevalent in actual
  689. usage only those plugged into the Russian PC community can tell. If
  690. the graphics usage turns out to be prevalent, these four symbols would
  691. be reasonable candidates for incorporation into Unicode, perhaps at
  692. positions 0x25ef to 0x25f3. */
  693.  
  694.  
  695. /* From Osnovnoj Variant to Unicode */
  696.  
  697. long ovtou[128] = {
  698. -2, -2, -2, -2, -2, -2, -2, -2,
  699. -2, -2, -2, -2, -2, -2, -2, -2,
  700. -2, -2, -2, -2, -2, -2, -2, -2,
  701. -2, -2, -2, -2, -2, -2, -2, -2,
  702. -2, -2, -2, -2, -2, -2, -2, -2,
  703. -2, -2, -2, -2, -2, -2, -2, -2,
  704. 0x0410,0x0411,0x0412,0x0413,0x0414,0x0415,0x0416,0x0417,
  705. 0x0418,0x0419,0x041a,0x041b,0x041c,0x041d,0x041e,0x041f,
  706. 0x0420,0x0421,0x0422,0x0423,0x0424,0x0425,0x0426,0x0427,
  707. 0x0428,0x0429,0x042a,0x042b,0x042c,0x042d,0x042e,0x042f,
  708. 0x0430,0x0431,0x0432,0x0433,0x0434,0x0435,0x0436,0x0437,
  709. 0x0438,0x0439,0x043a,0x043b,0x043c,0x043d,0x043e,0x043f,
  710. 0x0440,0x0441,0x0442,0x0443,0x0444,0x0445,0x0446,0x0447,
  711. 0x0448,0x0449,0x044a,0x044b,0x044c,0x044d,0x044e,0x044f,
  712. 0x0401,0x0451,0x0317,0x0316,0x0301,0x0300,0x2192,0x2190,
  713. 0x2193,0x2191,0x00f7,0x00b1,0x2116,0x00a4,0x25a0,   -1
  714. };
  715.  
  716. /* The same problem with the interpretation of 242-245 as in AV (these
  717. rows are definitely identical). The low positions of OV are probably
  718. identical to 176-223 in AV... */
  719.  
  720.  
  721. /* From ISO8859-5 to Unicode */
  722.  
  723. long newkoi8tou[128] = {
  724. -1, -1, -1, -1, -1, -1, -1, -1,
  725. -1, -1, -1, -1, -1, -1, -1, -1,
  726. -1, -1, -1, -1, -1, -1, -1, -1,
  727. -1, -1, -1, -1, -1, -1, -1, -1,
  728. 0x00a0,0x0401,0x0402,0x0403,0x0404,0x0405,0x0406,0x0407,
  729. 0x0408,0x0409,0x040a,0x040b,0x040c,0x00ad,0x040e,0x040f,
  730. 0x0410,0x0411,0x0412,0x0413,0x0414,0x0415,0x0416,0x0417,
  731. 0x0418,0x0419,0x041a,0x041b,0x041c,0x041d,0x041e,0x041f,
  732. 0x0420,0x0421,0x0422,0x0423,0x0424,0x0425,0x0426,0x0427,
  733. 0x0428,0x0429,0x042a,0x042b,0x042c,0x042d,0x042e,0x042f,
  734. 0x0430,0x0431,0x0432,0x0433,0x0434,0x0435,0x0436,0x0437,
  735. 0x0438,0x0439,0x043a,0x043b,0x043c,0x043d,0x043e,0x043f,
  736. 0x0440,0x0441,0x0442,0x0443,0x0444,0x0445,0x0446,0x0447,
  737. 0x0448,0x0449,0x044a,0x044b,0x044c,0x044d,0x044e,0x044f,
  738. 0x2116,0x0451,0x0452,0x0453,0x0454,0x0455,0x0456,0x0457,
  739. 0x0458,0x0459,0x045a,0x00a7,0x045c,0x045d,0x045e,0x045f
  740. };
  741.  
  742. /* Use newkoi8tou in combination with isotoibm to derive the unicode
  743. meaning of the Cyrillic range in the DKOI extension of EBCDIC. If
  744. someone has DKOI-8 text available, I'd love to actually try... */
  745.  
  746.  
  747.