Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save richistron/c613e49801b314972db58467ed36b498 to your computer and use it in GitHub Desktop.
Save richistron/c613e49801b314972db58467ed36b498 to your computer and use it in GitHub Desktop.
<U+FEFF> character showing up in files. How to remove them?
1) In your terminal, open the file using vim:
vim file_name
2) Remove all BOM characters:
:set nobomb
3) Save the file:
:wq
// taken from:
http://stackoverflow.com/questions/7297888/ufeff-character-showing-up-in-files-how-to-remove-them
Another recipe using awk
http://stackoverflow.com/questions/1068650/using-awk-to-remove-the-byte-order-mark
awk '{ if (NR==1) sub(/^\xef\xbb\xbf/,""); print }' INFILE > OUTFILE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment