在页面源

时间:2013-11-12 10:08:02

标签: html asp.net encoding

当我从浏览器显示页面源时,我看到如下页面源:

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html;&#32;charset=ISO-8859-9" />
<meta http-equiv="Content-Type" content="text/html;&#32;charset=windows-1254" />
<title></title>

但实际上是这样的:

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-9" />
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1254" />
    <title></title>

知道空格字符转换为&#32;的原因吗?它发生在页面源中的所有属性中,因此我不想使用htmldecode(),因为它需要很长时间。

1 个答案:

答案 0 :(得分:0)

32是空间的ASCII。 您可以使用WebUtility.HtmlDecode()获取空间