jeudi 1 janvier 2015

Forcing the conversion of files with different encodings to UTF-8


I have 100 files that when I issue the command file *.srt I see something like this:



file1.srt: ASCII English text
file2.srt: UTF-8 Unicode English text
file3.srt: UTF-8 Unicode text


multiple encodings... I want to convert all them to UTF-8, despite the encoding they were using.


I have tried this for a single file



iconv -f US-ASCII -t UTF-8 file1.srt > file1.new


but when I issue the command file again it still shows the file as



file1.srt: ASCII English text


I read the ASCII is subset of UTF-8 and for that reason the conversion is not being done but I want to force it.



  1. how do I force the conversion to work?

  2. how do I do that for multiple files?


I have tried other answers on this forum but none work and I end with the same file encodings as before.



Aucun commentaire:

Enregistrer un commentaire