Question

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?

Était-ce utile?

La solution

If the byte sequences are embedded in your buffer, a

:%substitute/\%ufeff//g

might already do the trick.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top