5

here is a subtitle file on http://subscene.com/subtitles/crank/farsi_persian/281992. if you download it you will see some codes like:

1
00:02:05,360 --> 00:02:07,430
åßÊæÑ¡ ãÇ åäæÒ ÏÇÑíã ãí ÑÎíã¿
ÎæÈå

2
00:02:07,600 --> 00:02:10,956
áíæÓ! ãÇ ÏÇÑíã í ÇÑ ãíäíã Èå ¿
æ Ïíå åí æÞÊ ãä Ñæ ÕÏÇ äãíÒäí

the thing i expect is:

1
00:02:05,360 --> 00:02:07,430
هكتور، ما هنوز داريم مي چرخيم؟
خوبه

2
00:02:07,600 --> 00:02:10,956
چليوس! ما داريم چي کار ميکنيم بچه ؟
و ديگه هيچ وقت من رو صدا نميزني

i reached it by changing the file extension from srt to txt, opening it with chrome browser, chenging encoding to arabic windows and re save file contents by select all text.

i have no idea how to do this with vim, or shell script. i tried :write ++enc=utf-8 russian.txt or set encoding or set fileencoding, but no luck.

thanks, mona

1 Answer 1

6

in vim:

after loading your file, don't do any modification. then you could do:

:e ++enc=cp1256

To save in utf-8, just

:w ++enc=utf-8

or you could do it in shell:

iconv -cf WINDOWS-1256 -t utf-8 problem.srt -o correct.srt
Sign up to request clarification or add additional context in comments.

1 Comment

It is working, but this only changes the way the file is displayed, how can I sae the file with this?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.