|
| ||
|
|
Code & tips >> Cyrillic code conversion program (cccp)
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 | ||