ASP MVC 可能存在编码问题,在 HTML 输出中显示回车符
这是一个奇怪的问题,
我有一个 ASP MVC 3 项目(仅为 Chrome 支持而开发),在过去的几周里,我注意到 HTML 输出中出现了这个奇怪的字符。
我认为这与文档的编码有关(甚至如果它是 UTF-8),我注意到的另一件事是 HTML 输出中的字符串中出现空格(下面来自 Chrome Web 检查器的屏幕截图):
如果我从检查器中删除这些,那么一切正常,但我无法解释为什么会这样东西首先就在那里。看起来 Visual Studio 中的视图正在输出源代码中的空格(和回车符)。
任何帮助将非常感激!
谢谢
This is a weird one,
I have an ASP MVC 3 project (developed for Chrome only support), and in the last couple of weeks I noticed this weird character appearing in the HTML output.
I think this has something to do with the encoding of the document (even if it's UTF-8) and the other thing I noticed are white spaces showing up in strings in the HTML output (screenshot below from the Chrome web inspector):
If I remove these from the inspector then everything works fine but I cannot explain why this stuff is there in the first place. Looks like the View in visual studio is outputting the white spaces (and carriage returns) as they are in the source code.
Any help would be really appreciated!
Thank you
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我发布了关于这个确切问题的问题日前。有趣的是,我刚刚尝试了一些东西,然后来这里更新我的帖子并看到了你的。
这一定是他们在 Chrome 上发布的最新版本的一个 bug(在它之前工作过)以及他们如何处理 -webkit-font,在我的具体情况下,
所以尝试在你的 css 中用 -webkit-font 注释掉所有内容..
希望这有帮助
I posted a question about this exact problem a few days ago. Funny thing i just tried some things out and came here to update my post and saw your.
This has to be a bugg with their latest release off Chrome (it worked before it) and how they handle -webkit-font, in my specfic case it was
so give it a try to comment out everything with -webkit-font in your css..
hope this helps