I've copied certain files from a Windows machine to a Linux machine. So all the Windows encoded (windows-1252) files need to be converted to UTF-8. The files which are already in UTF-8 should not be changed. I'm planning to use the recode
utility for that. How can I specify that the recode
utility should only convert windows-1252 encoded files and not the UTF-8 files?
Example usage of recode:
recode windows-1252.. myfile.txt
This would convert myfile.txt
from windows-1252 to UTF-8. Before doing this, I would like to know that myfile.txt
is actually windows-1252 encoded and not UTF-8 encoded. Otherwise, I believe this would corrupt the file.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…