类似如下的asp页面脚本,向数据库内userinfo表格插入name,password:
<!--#include file="conn.asp"-->
<%
dim name,password,sql
name=request("name")
password=request("password")
sql="insert into userinfo values('"&name&"','"&password&"');"
conn.execute(sql)
%>
当接收到的name为汉字时,就会出现500 (Internal Server Error)的报错信息,而无法实现插入sql语句。
这是因为当字符集Charset为UTF-8时,需要在该asp页面的顶端加上<%@Codepage=“65001”%>这句,二者为映射关系。