On Jan 20, 12:10 am, "Michael(Xi Zhang)" <[email protected]>
wrote:
> Hi All,
>
> I'm using gVim in Windows XP. I want use Vim as a HEX viewer.
>
> I open file with gvim's  -b  option . But when I check the file, some thing
> are not correct.
>
> For example, I have generate a 960KB file. I use some other HEX editor to
> view it, the file is exactly from 0x0 to 0xEFFFF.
>
> But with gVim, the offset is more than 0xF0000. I have compared the display,
> it seems sometimes gVim change the 0x9000 to 0x202020.
>
> I have tried to change the setting of encoding and fileencoding, but it
> doesn't work.
>
> Could anyone give me some suggestion?
>
> Some configuration in my vimrc file are:
>
> set encoding=utf-8
>
> set fileencodings=utf-8,chinese
>

I don't know if this is the cause, but it might be a possibility.

You only have 2 possible encodings in your fileencodings setting. In
UTF-8, not all bytes are valid. chinese is a 2-byte encoding, I
imagine some byte sequences are illegal here as well. I think it is
recommended that you always have a fallback to an 8-bit encoding like
latin1 in fileencodings, in case the file is not valid in any of the
multibyte encodings. In your case, it would fall back to using utf-8
anyway, even if invalid for utf-8. I do not know what effects this
has.

Try adding 'latin1' to the end of your fileencodings list to see if
that makes any difference.

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