Assume for example you have a file (file. txt) with encoding UTF-16 and want to convert to UTF-8.
Open the file with the command: vim file.txt
save the file with the command:
: write + + enc = utf-8
: write + + enc = utf-8 file_utf8.txt
The same result can 'be obtained from the command line:
iconv-f utf-16-t utf-8 file.txt> file_utf8.txt