#!/bin/bash
# Author: Mashrab Kuvatov <kmashrab@uni-bremen.de>
if [ $# = 0 ]
then
echo "Usage: htmlcp1251toutf8.sh infile"
echo
echo "Converts CP1251 file to UTF-8, HTML entities"
echo "(Cyrillic Uzbek characters) are also converted into UTF-8."
exit
fi
cat $1 | iconv -f cp1251 -t utf-8 | sed "s/Ў/Ў/g;s/Қ/Қ/g;s/Ғ/Ғ/g;s/Ҳ/Ҳ/g;s/ў/ў/g;s/қ/қ/g;s/ғ/ғ/g;s/ҳ/ҳ/g;s/ӄ/қ/g;s/қ/қ/g;s/Ў/Ў/g;s/Ӄ/Қ/g;s/ë/ё/g;s/¸/ /g"