我想转吗的函数是不是应该为:
public String getStr(String str)
{
try
{
String temp_p=str;
byte[] temp_t=temp_p.getBytes("ISO8859-1");
String temp=new String(temp_t);
return temp;
}
catch(Exception e)
{}
return "null";
}
用这个试试!
祝你好运!
public String getStr(String str)
{
try
{
String temp_p=str;
byte[] temp_t=temp_p.getBytes("ISO8859-1");
String temp=new String(temp_t);
return temp;
}
catch(Exception e)
{}
return "null";
}
用这个试试!
祝你好运!
解决方案 »
- window.open()打开一个子页面,在关闭时子页面刷新父页面
- jsp可以调用静态方法吗
- 关于汉化 ApplicationResources.properties的问题
- web登陆后能看到别的帐号的信息,是什么原因?急急急!!!
- 一个陈旧而没有解决的问题,问了3个月了,没有答案!
- 一个分页问题,马上给分
- 急求:关于触摸屏查询系统(jsp+javabean)的思路,大哥帮帮忙!
- 有没有一个函数或者方法可以取出post传递过来的所有参数和值
- gb2312是encoding还是charset?
- 模仿一个QQ空间动态的网址
- 我到底错在哪(数据库问题,高手请进!)
- 我用TOMCAT,为什么我在examples目录下可以运行SERVLET在自己的虚拟目录下却不行???
public String GB2Uni(String GB) {
//this is a method for servlet loading chinese data from db.
try {
if (GB==null){
return "";
}
GB=GB.trim();
byte[] tmp = GB.getBytes("Cp1252");
//you must change the byte code
String result = new String(tmp);
return result;
}
catch(java.io.UnsupportedEncodingException e) {
System.out.println("CommonFunction.GB2Uni UnsupportedEncodingException"+e);
return null;
}
}
%>
我曾经把汉字插到access中乱吗,可是 jsp取出来又一切正常。。