%% This file is part of the ANTOMEGA project version 0.6
%% -----------------------------------------------------
%% 
%% It may be distributed under the terms of the LaTeX Project Public
%% License, as described in lppl.txt in the base LaTeX distribution.
%% Either version 1.0 or, at your option, any later version.
%% Copyright (C) 2003 by Alexej Kryukov
%% Please report errors to: A.M. Kryukov <basileia@yandex.ru>

%% Conversion to Unicode from Russian/Ukrainian KOI8-RU encoding.

input:	1;
output:	2;

tables:

tabkoi8[@"40] = {
@"044E, @"0430, @"0431, @"0446, @"0434, @"0435, @"0444, @"0433,
@"0445, @"0438, @"0439, @"043A, @"043B, @"043C, @"043D, @"043E,
@"043F, @"044F, @"0440, @"0441, @"0442, @"0443, @"0436, @"0432,
@"044C, @"044B, @"0437, @"0448, @"044D, @"0449, @"0447, @"044A,
@"042E, @"0410, @"0411, @"0426, @"0414, @"0415, @"0424, @"0413,
@"0425, @"0418, @"0419, @"041A, @"041B, @"041C, @"041D, @"041E,
@"041F, @"042F, @"0420, @"0421, @"0422, @"0423, @"0416, @"0412,
@"042C, @"042B, @"0417, @"0428, @"042D, @"0429, @"0427, @"042A
};

expressions:

% Basic ASCII symbols
@"00-@"7F	=> \1;

% Basic Russian alphabet
@"C0-@"FF	=> #(tabkoi8[\1-@"C0]);

% Russian capital letter YO
@"B3		=> @"401;

% Russian small letter YO
@"A3		=> @"451;

% Ukrainian capital letter IE
@"B4		=> @"404;

% Ukrainian small letter IE
@"A4		=> @"454;

% Ukrainian-Byelorussian capital letter I
@"B6		=> @"407;

% Ukrainian-Byelorussian small letter I
@"A6		=> @"457;

% Ukrainian capital letter YI
@"B7		=> @"407;

% Ukrainian small letter YI
@"A7		=> @"457;

% Ukrainian capital letter GHE with upturn
@"BD		=> @"407;

% Ukrainian small letter GHE with upturn
@"AD		=> @"457;

% Byelorussian capital letter short U
@"BE		=> @"40E;

% Byelorussian small letter short U
@"AE		=> @"45E;

% all other symbols, including Unicode characters
.		=> \1;
