В редакторе vim выполнить следующие команды:

:e ++enc=cp1251
:set fileencoding=utf-8
:set fileformat=unix
:wq