I want to remove \xef\xbb\xbf marks (BOM) from my file. It's a text file to be fed to python, and the BOM marks are causing problems there. I tried :set nobomb but those are still there. How can I solve this problem and what might have caused this problem?

UPDATE: My file is obtained by combining (concatenating) many other files (using obabel software) each of which has BOM. So, probably set nobomb removes BOM mark only at the beginning of the new file. In such cases, how can I remove all BOMs?

有帮助吗?

解决方案

If the byte sequences are embedded in your buffer, a

:%substitute/\%ufeff//g

might already do the trick.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top