Why is  appearing in my HTML? [duplicate]

2018-12-31 22:03发布

I see this character in Firebug .

I don't know why this is happening, there's no such character in my code. For Firefox it's OK, but in IE everything breaks. I can't even search for this character in Google.

I saved my file with utf-8 encoding without bom.

enter image description here

标签: html
10条回答
明月照影归
2楼-- · 2018-12-31 22:47

An old stupid trick that works in this case... paste code from your editor to ms notepad, then viceversa, and evil character will disappears ! I take inspiration from wyisyg/msword copypaste problem. Notepad++ utf-8 w/out BOM works as well.

查看更多
浪荡孟婆
3楼-- · 2018-12-31 22:49

If you are using Notepad++, "Menu" >> "Encoding" >> "Convert to UTF-8" your "include" files.

查看更多
谁念西风独自凉
4楼-- · 2018-12-31 22:50

Just use notepad ++ with encoding UTF-8 without BOM.

查看更多
泪湿衣
5楼-- · 2018-12-31 22:52

"I don't know why this is happening"

Well I have just run into a possible cause:-) Your HTML page is being assembled from separate files. Perhaps you have files which only contain the body or banner portion of your final page. Those files contain a BOM (0xFEFF) marker. Then as part of the merge process you are running HTML tidy or xmllint over the final merged HTML file.

That will cause it!

查看更多
登录 后发表回答