From: alexeev@math.utah.edu (Valery A. Alexeev)
Subject: Re: Relcom
Organization: Department of Mathematics, University of Utah
Date: 17 Dec 92 22:26:43

In article <momotaro.724642959@cwis>, momotaro@cwis.unomaha.edu (Bryan Stack) writes:

> Can anyone tell me how to read the Relcom messages that are flooding
> our Usenet feed lately?  What software is needed to convert it to
> recognizable Russian?

If you are using GNUS under GNU Emacs for reading news then the
following could actually help you.
This will work if articles are decoded in KOI-8 as it is the case of the
server I exploit.

DISCLAIMER. I am a beginner lisp programmer, the code is pretty
clamsy. I would use an advice in improving it.


INSTRUCTIONS:

STEP 1. Save the following in the file called cyrill.el in the
directory that emacs knows about. Byte-compiling it doesn't hurt.

----CUT HERE------------------------------------------------

;;; cyrill.el written by Valery Alexeev in 10/92
;;; The standard GNU Copyright applies

(provide 'cyrill)

(defvar cyr-flag nil)

(defun gnus-cyr-flag (&optional arg)
"Sets the flag to decode subjects/articles with cyrillic characters"
    (interactive "p")
    (if (eq arg 1)
      ((lambda()
    (setq cyr-flag t)
    (message "Cyrrillic flag is set now")))
((lambda()
    (setq cyr-flag nil)
    (message "Cyrrillic flag is unset now"))))
)

(defun cyr() 
"Decode a buffer, containing cyrillic characters" 
      (interactive)
      (save-excursion
      (shell-command-on-region (point-min) (point-max) "cyrconv" t nil))
)

----CUT HERE--------------------------------------------------------

STEP 2. Put the following in your .emacs file:

----CUT HERE--------------------------------------------------------

(require 'cyrill "cyrill")
(setq gnus-Startup-hook 
   '(lambda ()
        (define-key gnus-Group-mode-map "\C-cc" 'gnus-cyr-flag)
))
(setq gnus-Article-prepare-hook 
	'(lambda ()
	  (if cyr-flag (cyr))
))
(setq gnus-Subject-prepare-hook 
	'(lambda ()
	  (if cyr-flag (cyr))
))

----CUT HERE--------------------------------------------------------

STEP 3. Compile the following code with cc or gcc, call the result
cyrconv and put it in the directory where you keep your binaries, that
is the one in the PATH.

----CUT HERE--------------------------------------------------------

/* Adopted from a code written by Steve Gaarder
(gaarder@theory.tc.cornell.edu) /

#include <stdio.h>
char transtbl[68][5] =
	{"\"", "?", "\"", "?",
	"yu", "a", "b", "ts", "d" , "e", "f", "g", "kh", "i", "y" , "k", "l",
	"m", "n", "o", "p", "ya", "r" , "s", "t", "u", "zh", "v", "'",
	"y", "z", "sh", "e", "shch", "ch", "`", 
	"YU", "A", "B", "TS", "D" , "E", "F", "G", "KH", "I", "Y" , "K", "L",
	"M", "N", "O", "P", "YA", "R" , "S", "T", "U", "ZH", "V", "'",
	"Y", "Z", "SH", "E", "SHCH", "CH", "`" };

main()
{
	int c;

	while ((c = getchar()) != EOF)
	{      	if ( c < 0xbc) putchar(c);
		else printf("%s",transtbl[c-0xbc]);
	}
}

----CUT HERE--------------------------------------------------------

STEP 4. To use: at any moment, while reading news in GNUS, type CTRL-c c
and all the subjects and articles that are decoded in KOI-8 will
became readable. You don't need any special fonts, drivers...
What will happen all the buffers in GNUS will be filtered through
a programm cyrconv, so you will see something like 

Mama myla ramu. Kuplyu zavod po proizvodstvu spirta.

that you can read after getting used to it. The program doesn't do
anything with the usual roman letters and numbers. You can always turn
it off by typing M-0 CTRL-c c.

	You can certainly also use cyrconv in a stand-alone mode.
	Another suggestion: one easily modifies cyrconv.c so that the
output is written in amstex using the standard transliteration scheme
by Amer. Math. Soc. for cyrillic.
One then typesets the result and prints it out.
There are some difficulties if the text contains not only cyrillic
characters. 

_______________
Imeite khoroshii den',
Valery.