# Code page 866

Code page 866 (CCSID 866) (CP 866, "DOS Cyrillic Russian") is a code page used under DOS and OS/2 in Russia to write Cyrillic script. It is based on the "alternative code page" (Russian: Альтернативная кодировка) developed in 1984 in IHNA AS USSR and published in 1986 by a research group at the Academy of Science of the USSR. The code page was widely used during the DOS era because it preserves all of the pseudographic symbols of code page 437 (unlike the "Main code page" or Code page 855) and maintains alphabetic order (although non-contiguously) of Cyrillic letters (unlike KOI8-R). Initially this encoding was only available in the Russian version of MS-DOS 4.01 (1990), but with MS-DOS 6.22 it became available in any language version.
The WHATWG Encoding Standard, which specifies the character encodings permitted in HTML5 which compliant browsers must support, includes Code page 866. It is the only single-byte encoding listed which is not named as an ISO 8859 part, Mac OS specific encoding, Microsoft Windows specific encoding (Windows-874 or Windows-125x) or KOI-8 variant. Authors of new pages and the designers of new protocols are instructed to use UTF-8 instead.
Two very similar but not identical encodings are standardised in GOST R 34.303-92 as KOI-8 N1 and KOI-8 N2 (not to be confused with the original KOI-8).

## Character set

Each non-ASCII character is shown with its equivalent Unicode code point. The first half (code points 0–127) of this table is the same as that of code page 437.
Code page 866 :
| | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | A | B | C | D | E | F |
| 0x | NUL | ☺ 263A | ☻ 263B | ♥ 2665 | ♦ 2666 | ♣ 2663 | ♠ 2660 | • 2022 | ◘ 25D8 | ○ 25CB | ◙ 25D9 | ♂ 2642 | ♀ 2640 | ♪ 266A | ♫ 266B | ☼ 263C |
| 1x | ► 25BA | ◄ 25C4 | ↕ 2195 | ‼ 203C | ¶ 00B6 | § 00A7 | ▬ 25AC | ↨ 21A8 | ↑ 2191 | ↓ 2193 | → 2192 | ← 2190 | ∟ 221F | ↔ 2194 | ▲ 25B2 | ▼ 25BC |
| 2x | SP | ! | " | # | $ | % | & | ' | ( | ) | * | + | , | - | . | / |
| 3x | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | : | ; | < | = | > | ? |
| 4x | @ | A | B | C | D | E | F | G | H | I | J | K | L | M | N | O |
| 5x | P | Q | R | S | T | U | V | W | X | Y | Z | [ | \ | ] | ^ | _ |
| 6x | ` | a | b | c | d | e | f | g | h | i | j | k | l | m | n | o |
| 7x | p | q | r | s | t | u | v | w | x | y | z | { | | | } | ~ | ⌂ 2302 |
| 8x | А 0410 | Б 0411 | В 0412 | Г 0413 | Д 0414 | Е 0415 | Ж 0416 | З 0417 | И 0418 | Й 0419 | К 041A | Л 041B | М 041C | Н 041D | О 041E | П 041F |
| 9x | Р 0420 | С 0421 | Т 0422 | У 0423 | Ф 0424 | Х 0425 | Ц 0426 | Ч 0427 | Ш 0428 | Щ 0429 | Ъ 042A | Ы 042B | Ь 042C | Э 042D | Ю 042E | Я 042F |
| Ax | а 0430 | б 0431 | в 0432 | г 0433 | д 0434 | е 0435 | ж 0436 | з 0437 | и 0438 | й 0439 | к 043A | л 043B | м 043C | н 043D | о 043E | п 043F |
| Bx | ░ 2591 | ▒ 2592 | ▓ 2593 | │ 2502 | ┤ 2524 | ╡ 2561 | ╢ 2562 | ╖ 2556 | ╕ 2555 | ╣ 2563 | ║ 2551 | ╗ 2557 | ╝ 255D | ╜ 255C | ╛ 255B | ┐ 2510 |
| Cx | └ 2514 | ┴ 2534 | ┬ 252C | ├ 251C | ─ 2500 | ┼ 253C | ╞ 255E | ╟ 255F | ╚ 255A | ╔ 2554 | ╩ 2569 | ╦ 2566 | ╠ 2560 | ═ 2550 | ╬ 256C | ╧ 2567 |
| Dx | ╨ 2568 | ╤ 2564 | ╥ 2565 | ╙ 2559 | ╘ 2558 | ╒ 2552 | ╓ 2553 | ╫ 256B | ╪ 256A | ┘ 2518 | ┌ 250C | █ 2588 | ▄ 2584 | ▌ 258C | ▐ 2590 | ▀ 2580 |
| Ex | р 0440 | с 0441 | т 0442 | у 0443 | ф 0444 | х 0445 | ц 0446 | ч 0447 | ш 0448 | щ 0449 | ъ 044A | ы 044B | ь 044C | э 044D | ю 044E | я 044F |
| Fx | Ё 0401 | ё 0451 | Є 0404 | є 0454 | Ї 0407 | ї 0457 | Ў 040E | ў 045E | ° 00B0 | ∙ 2219 | · 00B7 | √ 221A | № 2116 | ¤ 00A4 | ■ 25A0 | NBSP 00A0 |

## Variants

There existed a few variants of the code page, but the differences were mostly in the last 16 code points (240–255).

### Alternative code page

The original version of the code page by Bryabrin et al. (1986) is called the "Alternative code page" (Russian: Альтернативная кодировка), to distinguish it from the "Main code page" (Russian: Основная кодировка) by the same authors. It supports only Russian and Bulgarian. It is mostly the same as code page 866, except for codes F2$_{hex}$ through F7$_{hex}$ (which code page 866 changes to Ukrainian and Belarusian letters) and codes F8$_{hex}$ through FB$_{hex}$ (where code page 866 matches code page 437 instead). The differing row is shown below.
Alternative code page :
| | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | A | B | C | D | E | F |
| Fx | Ё 0401 | ё 0451 | 🮣 1FBA3 | 🮢 1FBA2 | 🮠 1FBA0 | 🮡 1FBA1 | → 2192 | ← 2190 | ↓ 2193 | ↑ 2191 | ÷ 00F7 | ± 00B1 | № 2116 | ¤ 00A4 | ■ 25A0 | NBSP 00A0 |

### Modified code page 866

An unofficial variant with code points 240–255 identical to code page 437. However, the letter Ёё is usually placed at 240 and 241. This version supports only Russian and Bulgarian. The differing row is shown below.
Modified CP 866 :
| | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | A | B | C | D | E | F |
| Fx | Ё 0401 | ё 0451 | ≥ 2265 | ≤ 2264 | ⌠ 2320 | ⌡ 2321 | ÷ 00F7 | ≈ 2248 | ° 00B0 | ∙ 2219 | · 00B7 | √ 221A | ⁿ 207F | ² 00B2 | ■ 25A0 | NBSP 00A0 |

### GOST R 34.303-92

The GOST R 34.303-92 standard defines two variants, KOI-8 N1 and KOI-8 N2. These are not to be confused with the KOI-8 encoding, which they do not adhere to.

#### KOI-8 N2

KOI-8 N2 is the more extensive variant and matches code page 866 and the Alternative code page except for the last row or stick. For this last row, it supports letters for Belarusian and Ukrainian in addition to Russian, but in a layout unrelated to code page 866 or 1125. Notably the Russian Ё/ё (which was unchanged between the Alternative code page and code page 866) is also in a different location. KOI-8 N2's final stick is shown below.
KOI-8 N2 (GOST R 34.303-92) :
| | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | A | B | C | D | E | F |
| Fx | SHY | № 2116 | Ґ 0490 | ґ 0491 | Ё 0401 | ё 0451 | Є 0404 | є 0454 | І 0406 | і 0456 | Ї 0407 | ї 0457 | Ў 040E | ў 045E | ■ 25A0 | NBSP 00A0 |

#### KOI-8 N1

The other variant, KOI-8 N1, is a subset of KOI-8 N2 which omits the non-Russian Cyrillic letters and mixed single/double lined box-drawing characters, leaving them empty for further internationalization (compare with code page 850). The affected sticks are shown below.
KOI-8 N1 (GOST R 34.303-92) :
| | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | A | B | C | D | E | F |
| Bx | ░ 2591 | ▒ 2592 | ▓ 2593 | │ 2502 | ┤ 2524 | | | | | ╣ 2563 | ║ 2551 | ╗ 2557 | ╝ 255D | | | ┐ 2510 |
| Cx | └ 2514 | ┴ 2534 | ┬ 252C | ├ 251C | ─ 2500 | ┼ 253C | | | ╚ 255A | ╔ 2554 | ╩ 2569 | ╦ 2566 | ╠ 2560 | ═ 2550 | ╬ 256C | |
| Dx | | | | | | | | | | ┘ 2518 | ┌ 250C | █ 2588 | ▄ 2584 | ▌ 258C | ▐ 2590 | ▀ 2580 |
| Ex | р 0440 | с 0441 | т 0442 | у 0443 | ф 0444 | х 0445 | ц 0446 | ч 0447 | ш 0448 | щ 0449 | ъ 044A | ы 044B | ь 044C | э 044D | ю 044E | я 044F |
| Fx | SHY | № 2116 | | | Ё 0401 | ё 0451 | | | | | | | | | ■ 25A0 | NBSP 00A0 |

### Lithuanian variants
#### KBL

The KBL code page, unofficially known as Code page 771, is the earliest DOS character encoding for Lithuanian. It mostly matches code page 866 and the Alternative code page, but replaces the last row and some block characters with letters from the Lithuanian alphabet not otherwise present in ASCII. The Russian Ё/ё is not supported, similarly to KOI-7.
A modified version, Code page 773, which replaces the Cyrillic letters with Latvian and Estonian letters, also exists.
KBL (Code page 771) :
| | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | A | B | C | D | E | F |
| Dx | ╨ 2568 | ╤ 2564 | ╥ 2565 | ╙ 2559 | ╘ 2558 | ╒ 2552 | ╓ 2553 | ╫ 256B | ╪ 256A | ┘ 2518 | ┌ 250C | █ 2588 | Ą 0104 | ą 0105 | Č 010C | č 010D |
| Ex | р 0440 | с 0441 | т 0442 | у 0443 | ф 0444 | х 0445 | ц 0446 | ч 0447 | ш 0448 | щ 0449 | ъ 044A | ы 044B | ь 044C | э 044D | ю 044E | я 044F |
| Fx | Ę 0118 | ę 0119 | Ė 0116 | ė 0117 | Į 012E | į 012F | Š 0160 | š 0161 | Ų 0172 | ų 0173 | Ū 016A | ū 016B | Ž 017D | ž 017E | ■ 25A0 | NBSP 00A0 |

#### LST 1284

Lithuanian Standard LST 1284:1993, known as Code page 1119 or unofficially as Code page 772, mostly matches the "modified" Code page 866, except for the addition of quotation marks in the last row and the replacement of the mixed single-double box-drawing characters with Lithuanian letters (compare code page 850). Unlike KBL, the Russian Ё/ё is retained.
It accompanies LST 1283 (Code page 774/1118), which encodes the additional Lithuanian letters at the same locations as LST 1284, but is based on Code page 437 instead. It was later superseded by LST 1590-1 (Code page 775), which encodes these Lithuanian letters in the same locations, but does not include Cyrillic letters, replacing them with Latvian and Estonian letters.
LST 1284:1993 (Code page 772 / 1119) :
| | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | A | B | C | D | E | F |
| Bx | ░ 2591 | ▒ 2592 | ▓ 2593 | │ 2502 | ┤ 2524 | Ą 0104 | Č 010C | Ę 0118 | Ė 0116 | ╣ 2563 | ║ 2551 | ╗ 2557 | ╝ 255D | Į 012E | Š 0160 | ┐ 2510 |
| Cx | └ 2514 | ┴ 2534 | ┬ 252C | ├ 251C | ─ 2500 | ┼ 253C | Ų 0172 | Ū 016A | ╚ 255A | ╔ 2554 | ╩ 2569 | ╦ 2566 | ╠ 2560 | ═ 2550 | ╬ 256C | Ž 017D |
| Dx | ą 0105 | č 010D | ę 0119 | ė 0117 | į 012F | š 0161 | ų 0173 | ū 016B | ž 017E | ┘ 2518 | ┌ 250C | █ 2588 | ▄ 2584 | ▌ 258C | ▐ 2590 | ▀ 2580 |
| Ex | р 0440 | с 0441 | т 0442 | у 0443 | ф 0444 | х 0445 | ц 0446 | ч 0447 | ш 0448 | щ 0449 | ъ 044A | ы 044B | ь 044C | э 044D | ю 044E | я 044F |
| Fx | Ё 0401 | ё 0451 | ≥ 2265 | ≤ 2264 | „ 201E | “ 201C | ÷ 00F7 | ≈ 2248 | ° 00B0 | ∙ 2219 | · 00B7 | √ 221A | ⁿ 207F | ² 00B2 | ■ 25A0 | NBSP 00A0 |

### Ukrainian and Belarusian variants

Ukrainian standard RST 2018-91 is designated by IBM as Code page 1125 (CCSID 1125), abbreviated CP1125, and also known as CP866U, CP866NAV or RUSCII. It matches the original Alternative code page for all points except for F2$_{hex}$ through F9$_{hex}$ inclusive, which are replaced with Ukrainian letters. Code page/CCSID 1131 matches code page 866 for all points except for F8$_{hex}$, F9$_{hex}$, and FC$_{hex}$ through FE$_{hex}$ inclusive, which are replaced with otherwise-missing Ukrainian and Belarusian letters, in the process displacing the bullet character (∙) from F9$_{hex}$ to FE$_{hex}$. The differing rows are shown below.
IBM code page 1125 (Ukrainian standard RST 2018-91) :
| | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | A | B | C | D | E | F |
| Fx | Ё 0401 | ё 0451 | Ґ 0490 | ґ 0491 | Є 0404 | є 0454 | І 0406 | і 0456 | Ї 0407 | ї 0457 | ÷ 00F7 | ± 00B1 | № 2116 | ¤ 00A4 | ■ 25A0 | NBSP 00A0 |
IBM code page 1131 (Belarusian) :
| | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | A | B | C | D | E | F |
| Fx | Ё 0401 | ё 0451 | Є 0404 | є 0454 | Ї 0407 | ї 0457 | Ў 040E | ў 045E | І 0406 | і 0456 | · 00B7 | ¤ 00A4 | Ґ 0490 | ґ 0491 | ∙ 2219 | NBSP 00A0 |
Also, the so-called CP 866ukr code page is a modified version of CP866 with the replacement of Ўў by Іі. Unlike CP1125, it maintains full compatibility of Ukrainian letters with CP866, although Ґґ is missing. It is not included in the standard Windows distributions, but some users install a home-made patch that allows using this encoding to work in command-line programs (such as FAR Manager) with filenames containing the Cyrillic Іі.

### Hryvnia variants

FreeDOS code page 30040 is a variant of code page 866 which replaces the currency sign (¤) at byte 0xFB with the hryvnia sign (₴, U+20B4).
FreeDOS code page 30039 is a variant of code page 1125 which makes the same replacement.

### Euro sign updates

IBM code page/CCSID 808 is a variant of code page/CCSID 866; with the euro sign (€, U+20AC) in position FD$_{hex}$, replacing the universal currency sign (¤).
IBM code page/CCSID 848 is a variant of code page/CCSID 1125 with the euro sign at FD$_{hex}$, replacing ¤.
IBM code page/CCSID 849 is a variant of code page/CCSID 1131 with the euro sign at FB$_{hex}$, replacing ¤.

### Lehner–Czech modification

An unofficial modification used in software developed by Michael Lehner and Peter R. Czech. It replaces three mathematic symbols with guillemets and the section sign which are commonly used in the Russian language. (Lehner and Czech created a number of alternative character sets for other European languages as well, including one based on CWI-2 for Hungarian, a Kamenicky-based one for Czech and Slovak, a Mazovia variant for Polish and a seemingly-unique encoding for Lithuanian. The modified row is shown below.
Lehner–Czech modification :
| | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | A | B | C | D | E | F |
| Fx | Ё 0401 | ё 0451 | Є 0404 | є 0454 | Ї 0407 | ї 0457 | Ў 040E | ў 045E | » 00BB | « 00AB | · 00B7 | § 00A7 | № 2116 | ¤ 00A4 | ■ 25A0 | NBSP 00A0 |

### Latvian variant

A Latvian variant, supported by Star printers and FreeDOS, is code page 3012 (earlier FreeDOS called it code page 61282). This encoding is nicknamed "RusLat".
CP3012 :
| | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | A | B | C | D | E | F |
| Bx | ░ 2591 | ▒ 2592 | ▓ 2593 | │ 2502 | ┤ 2524 | Ā 0100 | ╢ 2562 | ņ 0146 | ╕ 2555 | ╣ 2563 | ║ 2551 | ╗ 2557 | ╝ 255D | Ō 014C | ╛ 255B | ┐ 2510 |
| Cx | └ 2514 | ┴ 2534 | ┬ 252C | ├ 251C | ─ 2500 | ┼ 253C | ā 0101 | ╟ 255F | ╚ 255A | ╔ 2554 | ╩ 2569 | ╦ 2566 | ╠ 2560 | ═ 2550 | ╬ 256C | ╧ 2567 |
| Dx | Š 0160 | ╤ 2564 | č 010D | Č 010C | ╘ 2558 | ╒ 2552 | ģ 0123 | Ī 012A | ī 012B | ┘ 2518 | ┌ 250C | █ 2588 | ▄ 2584 | ū 016B | Ū 016A | ▀ 2580 |
| Ex | р 0440 | с 0441 | т 0442 | у 0443 | ф 0444 | х 0445 | ц 0446 | ч 0447 | ш 0448 | щ 0449 | ъ 044A | ы 044B | ь 044C | э 044D | ю 044E | я 044F |
| Fx | Ē 0112 | ē 0113 | Ģ 0122 | ķ 0137 | Ķ 0136 | ļ 013C | Ļ 013B | ž 017E | Ž 017D | ō 014D | · 00B7 | √ 221A | Ņ 0145 | š 0161 | ■ 25A0 | NBSP 00A0 |

### FreeDOS

FreeDOS provides additional unofficial extensions of code page 866 for various non-Slavic languages:
* 30002 – Cyrillic Tajik
* 30008 – Cyrillic Abkhaz and Ossetian
* 30010 – Cyrillic Gagauz and Moldovan
* 30011 – Cyrillic Russian Southern District (Kalmyk, Karachay-Balkar, Ossetian, North Caucasian)
* 30012 – Cyrillic Russian Siberian and Far Eastern Districts (Altai, Buryat, Khakas, Tuvan, Yakut, Tungusic, Paleo-Siberian)
* 30013 – Cyrillic Volga District – Turkic languages (Bashkir, Chuvash, Tatar)
* 30014 – Cyrillic Volga District – Finno-Ugric languages (Mari, Udmurt)
* 30015 – Cyrillic Khanty
* 30016 – Cyrillic Mansi
* 30017 – Cyrillic Northwestern District (Cyrillic Nenets, Latin Karelian, Latin Veps)
* 30018 – Latin Tatar and Cyrillic Russian
* 30019 – Latin Chechen and Cyrillic Russian
* 58152 – Cyrillic Kazakh with euro
* 58210 – Cyrillic Azeri
* 59234 – Cyrillic Tatar
* 60258 – Latin Azeri and Cyrillic Russian
* 62306 – Cyrillic Uzbek

## Code page 900

Before Microsoft's final code page for Russian MS-DOS 4.01 was registered with IBM by Franz Rau of Microsoft as CP866 in January 1990, draft versions of it developed by Yuri Starikov (Юрий Стариков) of Dialogue were still called code page 900 internally. While the documentation was corrected to reflect the new name before the release of the product, sketches of earlier draft versions still named code page 900 and without Ukrainian and Belarusian letters, which had been added in autumn 1989, were published in the Russian press in 1990. Code page 900 slipped through into the distribution of the Russian MS-DOS 5.0 LCD.CPI codepage information file.