I\'m used to using vim to modify a file\'s line endings:
$ file file file: ASCII text, with CRLF line terminators $ vim file :set ff=mac :wq $ file file file
From the doc:
:write ++enc=utf-8 russian.txt
So you should be able to change the encoding as part of the write command.