#!/bin/sh # by ramok 2007 if [ -z "$1" ]; then echo Variants list of cyrillic reencoding 1>&2 echo Usage: $(basename $0) cyrillic string 1>&2 exit 1 fi TEXT="$*" ENC="cp1251 koi8-r utf-8 cp866" CMD='iconv -cf $i1 -t $i2 | iconv -cf $i3 -t $i4' for i1 in $ENC; do for i2 in $ENC; do for i3 in $ENC; do for i4 in $ENC; do # отсеиваем "масло-масленные" перекодировки [ "$i1" == "$i2" -o "$i4" == "$i3" ] && continue [ "$i1" == "$i4" -a "$i2" == "$i3" ] && continue printf "%-60s%s\n" "$(eval echo \"$CMD\")" "$(echo "$TEXT" | eval "$CMD")" done done done done | sort -bk 12 # сортруем по первому перекодированному слову
Создано: 17-02-2009 17:27:10
изменено: 23-08-2009 10:57:24
Метки: cyrillic
from http://linsovet.com