空格和头部标签显示在正文内部


whitespace and Head tags displays inside body?

我完全用 Cakephp 在法语网站上工作,但它导致文件类型编码将字符嵌入到 html 中。所以我在记事本++中将文件类型更改为encode in utf-8,但它会导致问题,并在HTML正文中提供空格和头部标签,如下所示-


<meta content="IE=EmulateIE9" http-equiv="X-UA-Compatible">
<meta content="IE=EmulateIE8" http-equiv="X-UA-Compatible">
<title> : test</title>
<link rel="icon" type="image/x-icon" href="/mapubvideoRel/favicon.ico">
<link rel="shortcut icon" type="image/x-icon" href="/mapubvideoRel/favicon.ico">
<link href="/mapubvideoRel/css/main.css" type="text/css" rel="stylesheet">
<link href="/mapubvideoRel/css/helper.css" type="text/css" rel="stylesheet">
<link href="/mapubvideoRel/css/general.css" type="text/css" rel="stylesheet">
<link href="/mapubvideoRel/css/colorbox.css" type="text/css" rel="stylesheet">
<link href="/mapubvideoRel/css/App_Popup.css" type="text/css" rel="stylesheet">
<script src="/mapubvideoRel/js/jquery.js" type="text/javascript">
<script src="/mapubvideoRel/js/popup.js" type="text/javascript">
<script src="/mapubvideoRel/js/jquery.colorbox-min.js" type="text/javascript">
&#65279;

请帮忙。谢谢

您有带有 BOM 字符的文件。 使用物料清单检测器程序

Java:http://www.javapractices.com/topic/TopicAction.do?Id=257[推荐][查找并删除]

1-检查是否存在BOM
的URL2-从文件
中删除BOMPHP : http://www.dotvoid.com/2010/04/detecting-utf-bom-byte-order-mark/

我在 MVC6 Web 应用程序中也遇到了这个问题。

我已经在我的布局页面中添加了下面的行,问题已经解决。

<?xml version="1.0" encoding="UTF-8" ?>