Gary Johnson wrote:
On 2011-07-14, Linda W wrote:
I've been trying to add the following -- and added to about 3 separate
places
and non have work:

set fileencodings+=utf-16le
[...]

Anyway, with the changes in all 3 places, starting GVIM
still has file encodings set to the default:

fileencodings=ucs-bom,utf-8,default,latin1

So What am I doing wrong?

I'm pretty sure gvim reads .vimrc before .gvimrc, as I only
put my vim changes in .vimrc, unless they are gui-specific (like
a gui font)...and they seem to always get picked up... but it
isn't picking up this change!  It's like this change is being ignored.
I can't answer the 'fileencodings' question, but the name of the
personal vimrc and gvimrc files that Vim actually used should be in
$MYVIMRC and $MYGVIMRC, respectively. [snip]
Tony M is the list's unquestioned expert on these matters, but as he hasn't had a chance to reply yet, I'll dive in.

As to where your .vimrc is read, Gary J has provided good answers. You should do something like
  :echo $MYVIMRC
from within vim to access these variables -- your environment (o/s) probably doesn't know about them.

And now on to your encodings question. If your file starts with a bom, I believe that it is then used to tell your editor how the script is encoded -- IF your file happens to have one. Otherwise, the editor must guess. It does so by going from left to right down your fileencodings list. If your utf-16le encoded file doesn't happen to have a bom, then vim is going to try utf-8 before utf-16le, and utf-8 accepts all bytes. And so, vim uses utf-8.

Try using

  set fencs=^=utf-16le  (see  :help :set^=  )

and see if that solves your difficulty.

I'm ready to stand corrected whenever TonyM gets around to it!
Chip



--
You received this message from the "vim_use" 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