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

后端 未结 13 1138
甜味超标
甜味超标 2020-11-29 18:08

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 cha

13条回答
  •  感情败类
    2020-11-29 18:33

    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.

提交回复
热议问题