Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Vim display wchar text properly

Tags:

vim

encoding

I'm trying to look at a file that was saved without a BOM as wchar text. In my gVim window I see:

T^@E^@X^@T^@H^@E^@R^@

...which is really annoying. I want to edit this file as a regular text document, and I'd like vim to save it in the same format. I've tried doing :set encoding=utf-16 (and other variations such as utf-16le, ucs-2, and ucs-2le, but the document view never changes. How can I accomplish this?

like image 558
JSBձոգչ Avatar asked Jul 20 '10 21:07

JSBձոգչ


1 Answers

You can reload the file with the appropriate encoding:

:e ++enc=utf-16
like image 73
sth Avatar answered Sep 23 '22 19:09

sth