S
S
sudo rm -rf /2016-11-21 15:50:39
bash
sudo rm -rf /, 2016-11-21 15:50:39

How to read a file in BASH in one encoding and overwrite it in another?

I recently received a bunch of large and, for me personally, important text files. The problem is that they are written in cp1251, and I desperately need utf-8. So the question is, how to first read the file in 1251, and then write it with the same name and path, but already in utf-8? It is desirable (very) bash, because I do not want to spend a lot of time poking into the GUI.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
X
xotkot, 2016-11-21
@MaxLevs

$ iconv -f cp1251 -t utf-8 in.txt
How To: Determine and Change File Encoding

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question