asp简单代码如下: ================================================== <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=gb2312"> <% response.write request.form("aa") %> <FORM action="" method="post"> <textarea name="aa">here is [ ]</textarea> <INPUT type="submit" value="Submit"> </FORM> ==================================================
文件保存为GB2312编码,执行,提交,得到网页为 ================================================== <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=gb2312"> here is [ ] <FORM action="" method="post"> <textarea name="aa">here is [ ]</textarea> <INPUT type="submit" value="Submit"> </FORM> ==================================================
asp另存为UTF-8编码,charset也改为UTF-8,执行,网页为 ================================================== <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=utf-8"> here is [ ] <FORM action="" method="post"> <textarea name="aa">here is [ ]</textarea> <INPUT type="submit" value="Submit"> </FORM> =========================================== GB2312时,仍为
UTF-8时,似乎没有了……实际上,中间还是有个空格的。 它就是U+00A0:No-Break Space,即非间断空格,也就是我们的 。 也就是说,它不是HTML实体形式了,变成了一个字符。 经监控,网页提交时,被编码为%C2%A0,即非间断空格的UTF-8编码。
而GB2312时,被编码为%26nbsp%3B ============================================
|