On May 14, 10:01 pm, Mellified Man <[email protected]> wrote:
> On May 13, 5:38 pm, Ben Schmidt <[email protected]> wrote:
>
> > 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?
>
> I had "set encoding=unicode" in my .vimrc. Disabling this fixed the
> issue. Both fenc and fencs were unset. I don't recall why I thought I
> needed to change encoding in the first place.
>
> Thanks!

Since "Unicode" is not an encoding known to Vim, it will translate to
and from it using iconv, without realizing that "Unicode" often means
"UTF-16" or "UTF-16le", which Vim knows and handles in a special way,
because many characters, including all Latin-1 characters, have in
these encodings a representation which includes a null byte (and null
bytes have a special function in C strings). Therefore if you set
'encoding' to UTF-16 (with or without le or be) Vim will use UTF-8
internally, an encoding which can represent the same Unicode
codepoints as any endianness variant of UTF-16 or UTF-32, but whose
only use for a null byte is as the representation of the codepoint U
+0000 <control> = NULL.

See also http://vim.wikia.com/wiki/Working_with_Unicode

-- 
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