有兴趣的朋友可以看一下这个网页。http://www.interbbs.net/dispbbs.asp?boardID=6&ID=24918&star=3&page=1我们只看网页里面比较大的图片,以第二副为例(就是那张中间有很多队员在庆祝的画面)。查看这副图片的属性,可以看见其链接是http://photos.gznet.com/photos/1142130/1142130-Npa$nMt19b.jpg。但是如果查看整个网页的html代码,可以看见代码里写的是http://photos.gznet.com/photos/1142130/1142130-Npa$nMt19b.jpg,
不难发现,就是把“$”换成了“$”.我用sniffer抓过包,发现IE的请求里确实是http://photos.gznet.com/photos/1142130/1142130-Npa$nMt19b.jpg这个地址。
那么IE是如何知道把网页里的 Npa$nMt19b.jpg 换成 Npa$nMt19b.jpg 这个地址的呢?
这张网页里还有两副图,都是把“$”换成了“$”.呵呵,兴趣问题。无意中发现的。
不难发现,就是把“$”换成了“$”.我用sniffer抓过包,发现IE的请求里确实是http://photos.gznet.com/photos/1142130/1142130-Npa$nMt19b.jpg这个地址。
那么IE是如何知道把网页里的 Npa$nMt19b.jpg 换成 Npa$nMt19b.jpg 这个地址的呢?
这张网页里还有两副图,都是把“$”换成了“$”.呵呵,兴趣问题。无意中发现的。
你说的 “HTML代码里面 $=$符号” 是对每个网页都如此吗?
如果是,还有哪些类似的规定? 在哪里可以看见相关的资料?
谢谢。
类似于C字符串中,如果你想输出'\'就必须写成'\\'一样。
我现在想知道的是官方的文档,到底有些什么编码方式?
function HTMLEncode(fString)
if not isnull(fString) then
fString = replace(fString, ">", ">")
fString = replace(fString, "<", "<")
fString = Replace(fString, CHR(32), " ")
fString = Replace(fString, CHR(9), " ")
fString = Replace(fString, CHR(34), """)
fString = Replace(fString, CHR(39), "'")
fString = Replace(fString, CHR(13), "")
fString = Replace(fString, CHR(10) & CHR(10), "</P><P> ")
fString = Replace(fString, CHR(10), "<BR> ")
HTMLEncode = fString
end if
end function我不懂ASP,但看这代码,应该不只是Any ASCII code character whose code is greater-than or equal are converted to 0x80 to &#xxx, where xxx is the ASCII character value.
为什么又用“&”代替“&”????
$是unicode码吧
The HTMLEncode method applies HTML encoding to a specified string. This is useful as a quick method of encoding form data and other client request data before using it in your Web application. Encoding data converts potentially unsafe characters to their HTML-encoded equivalent.If the string to be encoded is not DBCS, HTMLEncode converts characters as follows:The less-than character (<) is converted to <.
The greater-than character (>) is converted to >.
The ampersand character (&) is converted to &.
The double-quote character (") is converted to ".
Any ASCII code character whose code is greater-than or equal are converted to 0x80 to &#xxx, where xxx is the ASCII character value.
If the string to be encoded is DBCS, HTMLEncode converts characters as follows:All extended characters are converted.
Any ASCII code character whose code is greater-than or equal to 0x80 is converted to &#xxx, where xxx is the ASCII character value.
Half-width Katakana characters in the Japanese code page are not converted. function HTMLEncode(fString) you put forward is defined by user himself, it's different from Server.HTMLEncode
the result you see may use HTMLEncode function defined by the user himself,in which he replace the "$" with "$" hope you can satisfied now