W
W
willgood2019-12-02 15:51:00
ubuntu
willgood, 2019-12-02 15:51:00

How to recursively re-encode all files in folders from w1251 to utf8 on Ubuntu?

Got a folder with a site. Some of the files are encoded in UTF-8, some in Windows 1251. How to bypass all files and change the encoding? OS Ubuntu 18.04

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
iddqda, 2019-12-02
@iddqda

how to convert: man iconv
how to reverse: man find

F
fara_ib, 2019-12-02
@fara_ib

for file in `find /etc -type f -name "*.*"`
do
iconv -f CP1252 -t UTF-8 $file | dos2unix > $file
done
Something like this...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question