< 0xEF,为0xBB,为0xBF>字符显示在文件中。如何删除它们? [英] <0xEF,0xBB,0xBF> character showing up in files. How to remove them?

查看:185
本文介绍了< 0xEF,为0xBB,为0xBF>字符显示在文件中。如何删除它们?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在压缩JavaScript文件,压缩器抱怨我的文件中有字符。



如何搜索这些字符并删除它们?

解决方案

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

我会假设该工具将如果您的文件中有其他utf-8,则断开,否则,此解决方法可能会帮助您。 (未验证...)



修改:添加了 -CSD 每tchrist的评论。


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?

解决方案

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.

这篇关于< 0xEF,为0xBB,为0xBF>字符显示在文件中。如何删除它们?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆