下面是二种编码
i. <%@ page contentType="text/html; charset=UTF-8"%>
ii. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
这二种编码都起到什么作用?谢谢。
i. <%@ page contentType="text/html; charset=UTF-8"%>
ii. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
这二种编码都起到什么作用?谢谢。
contentType的charset是指服务器发送给客户端时的内容编码
不过utf-8好像不能使服务器正确显示中文
第二个 是指客户端发送给服务器时的编码方式
contentType的charset是指服务器发送给客户端时的内容编码
不过utf-8好像不能使服务器正确显示中文,应该用gbk或者gb2312<%@ page contentType="text/html;charset=GBK"%>