页面中:
<meta http-equiv="Content-Type" content="text/html; charset=Unicode">
<form name="form1" method="post" action="http://localhost:2500/xxx?z=zzz&y=y&后面">
....
java代码: len = is.read(buf, 0, buf.length); //不一定一次就能读到客户端发过来的全部,所以一定要多次读才能保证全部读到。
buf2 = new byte[len];
System.arraycopy(buf, 0, buf2, 0, len);
str = new String(buf2,"Unicode");//,"UTF-8"
System.out.println("after read,len is:" +
len);
System.out.println(str);
jbuilder里打印出了几个空行,连请求头等信息都没有出现。
请问是什么原因?
<meta http-equiv="Content-Type" content="text/html; charset=Unicode">
<form name="form1" method="post" action="http://localhost:2500/xxx?z=zzz&y=y&后面">
....
java代码: len = is.read(buf, 0, buf.length); //不一定一次就能读到客户端发过来的全部,所以一定要多次读才能保证全部读到。
buf2 = new byte[len];
System.arraycopy(buf, 0, buf2, 0, len);
str = new String(buf2,"Unicode");//,"UTF-8"
System.out.println("after read,len is:" +
len);
System.out.println(str);
jbuilder里打印出了几个空行,连请求头等信息都没有出现。
请问是什么原因?
<meta http-equiv="Content-Type" content="text/html; charset=iso8859-1">中指定的编码方式进行转吗,还是先转吗,然后再进行urlencode,这两个步骤的先后顺序是怎样的?