On Tue, 11 Apr 2006, Benji Fisher wrote:
> On Tue, Apr 11, 2006 at 10:52:58AM +0100, Hugh Sasse wrote:
> >
> > 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 I'm doing this the hard way. Could someone point me at the
> > right part of the docs, please?
>
> I borrowed my children's XP computer to test this. I am not sure
> what you mean by "the hard way," maybe you already know this. What
In that getting into such low level details for a standard file format
on my platform probably meant there was a shortcut I'd missed....
> works for me is
>
> :set enc=utf-8
> :e ++enc=ucs-2le regfile.reg
Yes, this worked. I didn't know about ++enc which I see overrides enc
(encoding). For others reading this: having opened the file I didn't
need the filename to reopen it.
:e ++enc=ucs-2le
did the job.
>
> If I leave 'encoding' set to latin1 (the default), then I get a message
> "[CONVERSION ERROR]" when I load the file.
>
> HTH --Benji Fisher
Yes. Is there something I can set that will make the encoding ucs-2le when
every alternate char is a null (apart from the "bom[b]")? Maybe there's a
reason to not do that?
>
Thank you
Hugh