简体   繁体   English

为什么会弹出这个符号?

[英]Why does this ​ sign pop up?

Whilst running a code on notepad ++ that makes traffic lights run automatically I notices that this sign pop ups next to one of the buttons, ​.在记事本 ++ 上运行使交通灯自动运行的代码时,我注意到在其中一个按钮旁边弹出了这个标志,​。 I did some research and found out that to make it go away I need to specify the charset to equal utf-8.我做了一些研究,发现要让它消失,我需要将字符集指定为等于 utf-8。 I did this and the sign went away however I am confused because the default character encoding in HTML5 is utf-8 and it is even shown in notepad that it is using utf-8.我这样做了,标志消失了,但是我很困惑,因为 HTML5 中的默认字符编码是 utf-8,它甚至在记事本中显示它使用的是 utf-8。

I was wondering if someone could tell me why the sign pops up considering the fact that it was already encoded in utf-8.我想知道是否有人能告诉我为什么会弹出这个标志,因为它已经用 utf-8 编码了。

There are a number of things that all need to be set to UTF8.有很多东西都需要设置为UTF8。

The original file, of course, needs to be UTF8.原始文件当然需要是UTF8。

However, there is also an HTML header that specifies the encoding of the file.但是,还有一个 HTML 标头指定文件的编码。 If this header is set incorrectly, the browser may try another encoding.如果此标头设置不正确,浏览器可能会尝试其他编码。

So, using a specific over-ride in the HTML file can "work around" this issue.因此,在 HTML 文件中使用特定的覆盖可以“解决”这个问题。

There a bit of discussion here: <meta charset="utf-8"> vs <meta http-equiv="Content-Type">这里有一些讨论: <meta charset="utf-8"> vs <meta http-equiv="Content-Type">

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM