Saya pikir iconv adalah jawaban Anda...
Formulir man iconv:
NAME
iconv - Convert encoding of given files from one encoding to another
SYNOPSIS
iconv -f encoding -t encoding inputfile
DESCRIPTION
The iconv program converts the encoding of characters in inputfile from one coded
character set to another. The result is written to standard output unless otherwise
specified by the --output option.
.....
Jadi Anda mungkin bisa melakukan
find $my_base_dir -name "*.php" -o -name "*.html" -exec sh -c "( \
iconv -t ISO88592 -f UTF8 {} -o {}.iconv ; \
mv {}.iconv {} ; \
)" \;
Ini secara rekursif akan menemukan file dengan nama yang tepat dan menyandikannya kembali (file sementara diperlukan, karena iconv akan memotong keluaran sebelum mulai bekerja).
Ubuntu memiliki kode ulang
$ sudo apt-get install recode
$ recode UTF-8..latin1 *.php
Secara rekursif, terima kasih kepada Ted Dziuba:
$ find . -name "*.php" -exec recode UTF-8..latin1 {} \;
Bagaimana cara menulis stderr ke file saat menggunakan tee dengan pipa?
python mengonversi dokumen microsoft office menjadi teks biasa di linux