Scripts

bash: how to convert cp1251 file to utf-8

1. Add the below to ~/.bashrc:

myfun() {
cp "$1" "$1.bak"
iconv -f cp1251 -t utf-8 "$1.bak" > "$1"
}
alias 1251=myfun

2. Restart bash

3. To convert some file into utf-8, type:

1251 somefile.txt

Syndicate content