Monday, May 16, 2016

Re: Vim can't recognize text file, but Notepad++ can

On 5/15/2016 8:10 PM, Eric Christopherson wrote:
On Sun, May 15, 2016, Tim Chase wrote:  
On 2016-05-15 19:08, 'Suresh Govindachar' via vim_use wrote:  
I exported the entire Windows registry -- resulting text file is  about 500 MBytes.  I can open this text file in Notepad++ -- but  opening it in Vim results in just tons of @ signs.  
  Does the content alternate between "@" signs and actual content  characters?  


It sounds suspiciously like a UTF-16 file (Windows likes  to call this "Unicode") that Vim is reading yet somehow  misinterpreting.  
When the file is opened, status message at bottom is:

        "full path file name starting with \" [noeol][unix] 3912091L, 523120802C

Vim can read small files exported from the registry without doing anything special.
Is your vimrc trying to set the 'encoding' or  'fileencoding' settings in an incongruous way?    You might try      :e ++enc=utf16 file.txt
Waited for a very long time, nothing showed up in the buffer, and so aborted Ctrl-C.  Notepad++ opens the file quickly.
to force Vim to use utf16 to open the file.  It would also help to  know what vim outputs when you issue      :set encoding? fileencodings?  
        encoding=latin1
        fileencodings=ucs-bom

  I'm actually thinking the @ signs are the ones used by Vim when there  isn't enough space on the screen to completely fit one or more logical  lines of text in the file. I wouldn't expect that to happen with a  registry *text* file, though.  

No comments: