Edge警告说&quot“ content-type'标题Charset值应为UTF-8”。
Edge Dev-Tools很好,但是我只是不知道如何解决一些错误。
显然,index.html和两个SVG文件有问题。一个SVG使用IMG-TAG,另一个SVG使用CSS。
我尝试了将其添加到SVG中的其他方面:
<?xml version="1.0" encoding="utf-8"?>
对于HTML文件和SVG文件,我也尝试了其中的一种变体
<meta charset="utf-8">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我也花了很长时间试图制定此警告信息。
通过检查Microsoft Edge的DevTools中的“网络”选项卡,我发现仅在从缓存中检索数据时,即从文件中加载数据时才显示警告消息。
我不知道这一点的含义。但是,知道我的标题实际上正确编写了,这让您感到欣慰。
I too spent ages trying to work out this Warning message.
By examining the Network tab in Microsoft Edge's DevTools, I discovered that the Warning message is shown only when data is retrieved from cache, not when it is loaded from file.
I do not know the implications of this. But it is a relief to know that my headers are in fact written correctly.
错误显示了从服务器发送的实际文件上显示的,HTTP标头
content-type
应另外设置charset
值。要这样做取决于您正在使用的后端服务器。
c#aspnetcore(kestrel)中的示例,在服务静态文件时,您可以使用这些额外的映射来修改内容类型提供商:
The error displays that on the actual file that is sent from the server, that the http header
Content-Type
should additionally set thecharset
value.To do this depends on which backend server you are using.
Example in C# AspNetCore (kestrel), when serving static files you could modify the content type provider with these extra mappings:
我正面临同一问题。
浏览器只希望您定义 Mime Type
I was facing the same issue
The browser just wants you to define the mime type