To remove an UTF-8 BOM from a file
Today I've encounter a bunch of nasty UTF-8 files beginning with a BOM.
And of course, they were read by a tool that couldn't read and UTF-8 file beginning with a BOM.
Here's the solution (the files were js files):
find . -type f *.js -exec sed -i -e '1s/^\xEF\xBB\xBF//' {} \;
And of course, they were read by a tool that couldn't read and UTF-8 file beginning with a BOM.
Here's the solution (the files were js files):
find . -type f *.js -exec sed -i -e '1s/^\xEF\xBB\xBF//' {} \;