As an update to the issue with Vim not treating a file as UTF-8 Benny wrote about earlier, there’s more to note:
- The file in question contained two lines that were copied from the Other BSD, which were not UTF-8. This probably led to Vim not wanting to treat the entire file as UTF-8. (This is not normally a problem in vi(1), AFAIK (but in nvi in Debian, which truncates the file on write, with no way to recover), and jupp even has mixed-encoding files as a primary use case.)
- When treating the file as UTF-8 forcefully, which Benny used, the file was saved with the offending bytes replaced by question marks (which was discovered by me in cvs(1) diff(1), leading to a fix and this post-mortem analysis)
This is apparently something every editor user should know about. Another lesson learned: run $VCS diff before committing!
And something for me to take from this: check file encodings when importing from poorer OSes, and in general.