我也有这个问题 我用的是mysql 把中文存到数据库里 然后查看数据库 都是乱吗 也不知道是 数据库的问题还是JAVA的问题
解决方案 »
- 看过Spring Autowire源码的进
- 求大侠帮我配置这2张表的hibernate映射文件(多对一)
- 请教:如何从dom Element 对象 创建新的XML文档,没有Document对象
- 请教一个中文问题。。。。。。。。。。。。。。。。。。。
- 请问eclipse有没有像myEclipse那样的database explorer perspective的插件啊?
- 配置tomcat虚拟主机,出现子目录jsp文件无法引用类库,着急啊,请问了。
- 读去zip文件
- axis+tomcat就能开发webService吗
- 有关struts,高手请进,高分相送,急!
- jbuilder下datasource的配置问题
- HttpServletRequest\HttpSession\ServletConfig的问题
- This JDBC 2.0 method is not implemented 这是怎么回事?
user=game_user&password=game_pass&useUnicode=true&characterEncoding=GBKsqlserver可以要自己转换编码才不是乱码
new String(str.getBytes("8859_1"),"gbk")...不晓得是不是这样试的
aa=new String(aa.getBytes("ISO-8859-1"),"GBK");
然后再插入数据库就OK了。
public static String getWriteStr(String str) {
try {
String temp_p = str;
byte[] temp_t = temp_p.getBytes("GBK");
String unicode = new String(temp_t,"ISO8859-1");
return unicode;
}
catch(Exception e) {
return "null";
}
} public static String getReadStr(String str) {
try {
String temp_p = str;
byte[] temp_t = temp_p.getBytes("ISO8859-1");
String unicode = new String(temp_t,"GBK");
return unicode;
}
catch(Exception e) {
return "null";
}
}