<html>
<%@ page contentType="text/html; charset=GB2312" %>
<%
String tt="你是";
try
{
tt=tt.toString();
}
catch(Exception e){}
%>
<%=tt%>
</html>
<%@ page contentType="text/html; charset=GB2312" %>
<%
String tt="你是";
try
{
tt=tt.toString();
}
catch(Exception e){}
%>
<%=tt%>
</html>
解决方案 »
- 传智播客 黑马程序员JAVA视频分享,0基础到高手的蜕变,不看后悔~~~~
- 下拉框的onchange事件
- 问个servlet里方法封装成util工具类的方法
- struts2 高手帮帮忙。。。
- CSDN都没人能回答这样的问题,难道是这个问题超级巨难
- js自动填表,各位兄弟都进来看看
- 想学习JSP,请大虾和前辈们给点意见?
- 关于网站由tomcat换至weblogic的问题 高手请进 急~~~~~
- j2sdk+tomcat:把我的所有都给你(money)
- 有关使用 JspSmartUpload.class 的两个问题?
- 大家帮忙,配置jsp问题
- 谁知道javax.management包在哪里可以找到!
<%@ page contentType="text/html; charset=GBK" %>
有时候又改为temp=tt.getBytes("gb2312");好使
<%@ page contentType="text/html; charset=GB2312" %>
<%
String tt="你是";
try
{
byte[] temp;//
temp=tt.getBytes("ISO-8859-1");
tt=new String(temp,"GB2312");
}
catch(Exception e){}
%>
<%=tt%>
</html>
加个方法:
<%!public getStr(String str) throws Exception
{ try{
String temp=str;
byte[] temp_p=temp.getBytes("ISO-8859-1");
return new String(temp_p,"GBK");;
}catch(Exception e)
{
}
%>