How do I remove a \ufeff character in my webpage scripts?

后端 未结 2 1627
囚心锁ツ
囚心锁ツ 2020-12-09 11:40

I am trying to, simply put, remove a hidden zero-width-line-break character (U+FEFF) in my script. The webpage that it has appeared on is at http://cynicode.co.uk (Please no

相关标签:
2条回答
  • 2020-12-09 12:17

    Here is a solution to a similar issue: Extra BOM character in HTML invalidating DOCTYPE tag

    Basically the source of the issue are PHP files encoded in UTF8 with BOM, encoding them in UTF-8 without BOM solves the issue.

    Notepad++ UTF-8 encoding without BOM

    0 讨论(0)
  • 2020-12-09 12:38

    Some of your .php files (probably ./functions/page.php contains Byte Order Mark. If you are using some IDE, check this file's encoding properties and with luck you will be able to remove it.

    Edit If you use *nix, Elegant way to search for UTF-8 files with BOM? should help.

    0 讨论(0)
提交回复
热议问题