中文编码问题,转换一下就行了。
给你个函数
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){
e.printStackTrace();
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){
e.printStackTrace();
return "null";
}
}
解决方案 »
- 关于Runtime.getRuntime().exec(cmd);问题,请求大神帮忙解决,昨天一晚上没搞出来
- 这个SQL怎么写?
- MyEclipse9.0中建立WebService时,怎么添加Xfire?在线等哦
- spring 配置事务回滚
- List内容显示为多行问题?
- tomcat连接sql2000数据库问题
- 关于java/jsp/web毕业论文设计!
- jsp初学者请教大家:java.lang.NoClassDefFoundError: org/apache/tools/ant/util/FileUtils
- 哪里有免费的报表控件
- ORACLE连接失败
- 初学者,请高手指教!
- 如果您是主考官,四小时机试jsp相关内容,用jbuilder,不考ejb
<%=request.getParamter("userName")%>显示出来的仍是乱码啊!说明设置了request.setCharacterEncoding("gb2312")这个是无效的