How do I remove  from the beginning of a file?

前端 未结 23 1416
攒了一身酷
攒了一身酷 2020-11-22 06:21

I have a CSS file that looks fine when I open it using gedit, but when it\'s read by PHP (to merge all the CSS files into one), this CSS has the following characters prepend

23条回答
  •  眼角桃花
    2020-11-22 06:59

    If you need to be able to remove the BOM from UTF-8 encoded files, you first need to get hold of an editor that is aware of them.

    I personally use E Text Editor.

    In the bottom right, there are options for character encoding, including the BOM tag. Load your file, deselect Byte Order Marker if it is selected, resave, and it should be done.

    Alt text http://oth4.com/encoding.png

    E is not free, but there is a free trial, and it is an excellent editor (limited TextMate compatibility).

提交回复
热议问题