把页面的编码与数据的编码统一的两种方法:

把页面的编码与数据的编码统一的两种方法:

1 //字符编码的转换(1)
2     /* String url="jdbc:odbc:DRIVER={Microsoft Access Driver (*.mdb, *.accdb)};DBQ=D:/student.accdb?useUnicode=true&characterEncoding=GB2312"; */
1     //字符转换(2)
2                 /* name = new String(name.getBytes("x-sjis"),"GBK");
3                 fromw = new String(fromw.getBytes("x-sjis"),"GBK");
4                 school = new String(school.getBytes("x-sjis"),"GBK");
5                 major = new String(major.getBytes("x-sjis"),"GBK"); */

 

 

posted @ 2013-01-15 11:21  茶陵后  阅读(203)  评论(0编辑  收藏  举报