Alex Lane's Corner of Texas


Home Who am I? PalmPilot Chess PGP Key *Code tips Links

Code & tips >> Cyrillic code conversion program (cccp)

Disclaimer
All software available through this site is provided "as-is" and without warranty of any kind, express, implied, or otherwise, including without limitation, any warranty of merchantability or fitness for a particular purpose. You agree that in no event shall Alex Lane or Galexi Services be liable for any special, incidental, indirect or consequential damages of any kind, or any damages whatsoever resulting from loss of use, data or profits, whether or not advised of the possibility of damage, and on any theory of liability, arising out of or in connection with the use or performance of any software received from this site.

When you're faced with the task of determining what coding a particular Cyrillic file employs, this handy little utility can help identify the correct coding (from among KOI-8R, Windows-1251, and Alternative) using as few as 32 characters of Cyrillic text. In addition, you can specify (using command-line arguments) which of the three codings to convert the source text to, and if you wish, to perform the conversion even if the program's analysis is not conclusive. I plan to use this program on my Linux box as part of a procmail filter that would convert all incoming Cyrillic text into KOI-8R, the de facto Cyrillic code mapping standard for *nix.

Run from the command line with no arguments, the program shows the following information:

Usage: cccp -tvwkafh
   t = tell what coding is used
   v = verbosely tell what coding is used
   w = convert text to Windows-1251 mapping
   k = convert text to KOI-8R mapping
   a = convert text to Alternative (DOS) mapping
   f = force conversion even if analysis is inconclusive
   h = print this help message, with version information
   input from stdin (standard input); output to stdout (standard output)
   e.g., cccp -t <infile.txt
         cccp -k <infile.txt >outfile.txt

While I pause to try to figure out the best way to post this program, if you find yourself in need of this utility, please drop me e-mail (see below).



(If the above date is a hundred years or so off, your browser's Java interpreter isn't current.)

© 1999-2000 by Alex Lane. Send mail to: alex@galexi.com.

Home | Who am I? | PalmPilot | Chess | PGP public key | Code & tips | Bookmarks