2

I have a text file (refs.bib) in my Dropbox that was created using Vim on macOS. I open it on macOS Vim, the banner in the editor gives the details unix | utf-8 | bib and the file is legible. I do not make any changes and exit Vim.

I then open the file on Vim on my PC (through a terminal emulator on Windows Subsystem Linux), and the file is unintelligible (I see a repeated string of ^@^@^@^@^@^@^@^@^@). The banner reads unix | utf-8 | bib (same as it did on macOS) except now next to the file name it says [noeol]. I close the file without making any changes.

Then when I open the file again on macOS, it's now unintelligible there too, and gives the same banner unix | utf-8 | bib now with the [noeol] next to the file name. The file continues to be unintelligible on WSL Vim as well.

I know [noeol] means there's no EOL at the end of file, but I didn't make any changes to the file. How can opening a file cause it to become unintelligible on both platforms? I thought this might be an encoding issue, but Vim never used anything other than utf-8.

rorty
  • 123
  • 3
  • Those symbols look like a series of null bytes. You could try xxd’ing it to see if the original data is there, but it’s possible the file is just corrupted – D. Ben Knoble Mar 29 '20 at 14:00

0 Answers0