On Tue, 11 Apr 2006, Yakov Lerner wrote:
> On 4/11/06, Hugh Sasse <[EMAIL PROTECTED]> wrote:
> > On Tue, 11 Apr 2006, Yakov Lerner wrote:
> >
> > > > Date: Fri, 7 Apr 2006 12:08:23 +0100 (WEST)
> > > > From: Hugh Sasse <[EMAIL PROTECTED]>
> > > > To: Vim Help list <[email protected]>
> > > > Subject: editing WinXP text files - multibyte?
> > > >
> > > > If, on WinXP, I do
> > > >
> > > > regedit /e regfile.reg
> > > >
> > > > I get a file with the contents of the registry. However, in my Gvim
> > > > (6.4) I see nulls for every other character (^@), which agrees with
> > > > remarks about ucs-2le in the docs. This is particularly
> > > > unpleasant to read and edit. Notepad will display it to read, but
> > > > for editing I'd rather use gvim. Both
> > > > :he utf-16 | he ucs2-le
> > > > turn up nothing, and the utf-8 things don't seem relevant. :he
> > > > encoding tells me I can't use that to edit a file that has loaded
> > > > incorrectly, so I'll have to re-open the file. But that means
> > > > right-clicking the file to access vim won't work.
> > >
> > > I think you need to set option 'fileencodings' properly in
> > set fileencodings+=utf-8,utf-16,ucs-2le
> > set fileencoding=ucs-2le
> > set bomb
> >
> > and trying
> > set fileencoding=utf-16
> > set fileencoding=ucs-bom
> >
> > seems to make no difference:- set fenc? always tells me it is blank
> >
> > and
> > set fileencodings+="utf-8,utf-16,ucs-2le"
> > set fileencoding=ucs-2le
> >
> > doesn't help either, nor does removing the + and putting "ucs-bom" in
> > there explicitly.
> >
> > So I'm still puzzled....
>
> How about this:
> au BufReadPost *.reg set fenc=...
Possibly, but isn't there a way to trigger heuristics, similar to
the detection of DOS/Unix line endings?
>
> What's value of your 'encoding' ?
> :set encoding?
Latin1. Changing it to Unicode I see nothing at all in the reg file,
and I can't edit my vimrc anymore without resetting it and doing :e<return>
>
> Yakov
>
Thank you
Hugh