I have a .srt file that displays as gibberish when I open it in gEdit in ubuntu. So I want to convert it to utf8 to be able to read it.
When I try to figure out what the encoding it give:
file -i x.srt x.srt: text/plain; charset=unknown-8bit In another attempt I found:
find . -type f -print | xargs file ./x.srt: Non-ISO extended-ASCII text, with CRLF line terminators Also I tried enca:
enca x.srt enca: Cannot determine (or understand) your language preferences. Please use `-L language', or `-L none' if your language is not supported (only a few multibyte encodings can be recognized then). Run `enca --list languages' to get a list of supported languages. and
enca -L Persian x.srt enca: Cannot determine (or understand) your language preferences. Please use `-L language', or `-L none' if your language is not supported (only a few multibyte encodings can be recognized then). Run `enca --list languages' to get a list of supported languages. So I am wondering how to know the encoding and eventually convert it to a usable format.
other.head -n 20 x.srt | od -tx1)?iconv -f iso-8859-1 -t utf-8 < file.txt > out.txt