On 14/05/11 8:07 AM, Mellified Man wrote:
I'm using MacVim 7.3 build 53 on OS X10.6.7. I create a new file using
CMD+o or CMD+t, enter some text, then save and close the file. When I
open the file again every character I entered is pre-pended with two
characters:
^@

If I cat the file I can grab the invalid input and paste the file
contents back in, save, and the file is fine after I reopen it.

If I open a new file, save it, then enter new text and save it is file
upon reopening.

I wouldn't be shocked to learn this is the result of something in
my .vimrc file but I have no idea where to look.

^@ is a null byte. So this sounds encoding-related to me. It feels like
the file is being read as latin1 or utf8 but originally being written as
utf-16 or ucs2.

So I would investigate the 'fenc' and 'fencs' options, and perhaps even
'enc'. If you mess with them in your .vimrc, you may well have made a
mistake. It sounds to me like 'fenc' is being given a default that
'fencs' doesn't recognise upon reopening or something like that.

Comparing the value of 'fenc' when the file is originally being created
and looks right with that when it is reloaded and looks wrong could
help, too. Use

:verbose set fenc?

Ben.



--
You received this message from the "vim_mac" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Reply via email to