进行一下编码的转换
String str2= new String(str1.getBytes(),"8859_1");
String str2= new String(str1.getBytes(),"8859_1");
解决方案 »
- 关于quartz集群的问题。
- 客户端如何得到webservice里的list集合值---java
- spring 加载jar包后 启动tomCat异常500
- 请教一个Hibernate中一对多关系的查询问题.
- 通过thin驱动方式连接oracle后使用hibernate来插入clob类型的字段的值出错
- 请问我为什么装不上Tomcat啊
- 何处有weblogc6或7的下载。
- 用jb7+weblogic编写jsp出现问题 急。。
- 1.用ctrl+shift+s,没法自动生成toString方法.
- linux上运行jar包,oracle数据库拒绝连接
- 来者有分!关于struts构架的网站里每个页面的状态验证问题!
- local接口的ejb自动测试问题
二、在web.xml中用filter处理,就不需要你再每页都处理了。
比如设置mysql: default-character-set=gbk 之类
public String getCNString(String strEnglish)
{
String strTemp = null;
byte[] baTemp = null;
try
{
//=====================================================
// 注意下面的 ISO-8859-1 可以用 GBK , 或者 GB2312替换
//======================================================
baTemp = strEnglish.getBytes("ISO-8859-1");
strTemp = new String(baTemp);
}
catch (UnsupportedEncodingException ex)
{
strTemp = null;
}
return strTemp;
}