Wednesday, December 2, 2009

Re: Windows Registry Editor text files (.REG) in Unicode (?) encoding - displayed as garbage

Frantisek Rysanek wrote:
> And that's where I have a problem with .REG files.
> If the file is encoded as plain ASCII, that's no problem.
> The problem is that Regedit in XP exports Unicode (or what), maybe
> utf-16 (or some other multibyte charset). If I try "edit with Vim" on
> such files, I get a screenful of garbage.
> Any ideas are welcome :-)
---
Are you using 'gvim' for win32? How is your vim compiled?

You need to make sure you have a version with the multi-byte option
compiled in. Then it should autodetect the correct format for these
files.

When I use vim (win32 or win64), I use 'gvim' -- which is fully
UTF-8 compliant. A localized, 8-bit, ASCII-only version of vim
won't work.

The reg files are "Little-endian UTF-16 Unicode with CRLF line terminators",
with vim showing their encoding as "utf-16le".

If you do a 'set' command, you should see fileencodings set to:

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

It's important that the "ucs-bom" is before the utf-8 or vim won't
detect bom files correctly.

Good luck!
linda

--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php

No comments: