/rusxmms/librcd

To get this branch, use:
bzr branch http://suren.me/webbzr/rusxmms/librcd

« back to all changes in this revision

Viewing changes to statgen/doit

  • Committer: Suren A. Chilingaryan
  • Date: 2005-06-16 23:19:27 UTC
  • Revision ID: Arch-1:ds@dside.dyndns.org--darksoft-2004%librcd--main--0.1--base-0
initial import

(automatically generated log message)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /bin/bash
 
2
 
 
3
if [ -z "$1" ]; then
 
4
    echo "Usage: doit <file name>"
 
5
    exit
 
6
fi
 
7
 
 
8
# In some CP866 texts used "Yo" and "N" simbols from CP1251 encoding. This fixes it.
 
9
dos2unix -U $1
 
10
 
 
11
cat $1 | sed -e "s/�/�/g;s/�/N/g;s/�/�/g" | iconv -f CP866 -t KOI8-R > $1.koi
 
12
cat $1 | sed -e "s/�/�/g;s/�/N/g;s/�/�/g" | iconv -f CP866 -t CP1251 > $1.win
 
13
cat $1 | sed -e "s/�/�/g;s/�/N/g;s/�/�/g"  > $1.alt
 
14
 
 
15
#cat $1 | sed -e "s/�/�/g;s/�/�/g;s/�/�/g" | iconv -f CP866 -t UTF-8 > $1.utf
 
16
 
 
17
export LC_CTYPE="ru_RU.KOI8-R"
 
18
./generate $1.koi koi > russian_table.h  2> header1.tmp
 
19
./generate $1.koi win >> russian_table.h  2> header2.tmp
 
20
./generate $1.koi alt >> russian_table.h  2> header3.tmp
 
21
#./generate $1.win win >> russian_table.h 2> header2.tmp
 
22
#./generate $1 alt >> russian_table.h 2> header3.tmp
 
23
 
 
24
cmp header1.tmp header2.tmp
 
25
if [ $? -ne 0 ]; then
 
26
    echo "Different number items in win & koi tables. Strange..."
 
27
    rm -f russian_table.h
 
28
else
 
29
    cmp header1.tmp header3.tmp
 
30
    if [ $? -ne 0 ]; then
 
31
        echo "Different number items in win & koi tables. Strange..."
 
32
        rm -f russian_table.h
 
33
    else
 
34
        cat header1.tmp >> russian_table.h
 
35
    fi
 
36
fi
 
37
 
 
38
rm -f header?.tmp
 
39
rm -f $1.koi
 
40
#rm -f $1.win
 
41
#rm -f $1.alt
 
42
#rm -f $1.utf