<0xEF,0xBB,0xBF> character showing up in files. How to remove them?

file, unicode, utf, utf-8

Solution

perl -pi~ -CSD -e 's/^\x{fffe}//' file1.js path/to/file2.js

I would assume the tool will break if you have other utf-8 in your files, but if not, perhaps this workaround can help you. (Untested ...)

Edit: added the `-CSD` option, as per tchrist's comment.

Problem

I am doing compressing of JavaScript files and the compressor is complaining that my files have `` character in them. How can I search for these characters and remove them?

Original source

Related problems