用下面的方法转了,还是不行。
String chs=”中文”;
byte[] bchs=chs.getBytes();
chs = new String(bchs,”8859_1”);不知道下面的方法行不行:http://www.neweasier.com/article/2002-08-07/1028722985.html 试了再回来。
String chs=”中文”;
byte[] bchs=chs.getBytes();
chs = new String(bchs,”8859_1”);不知道下面的方法行不行:http://www.neweasier.com/article/2002-08-07/1028722985.html 试了再回来。
解决方案 »
- 【求助】如何用js实现点击标签之后改变标签
- 怎样获取struts1返回的页面的url
- ssh架构,mysql数据库,页面插入后数据库为空
- 求一个最简单的js代码
- 关于JSP页面自动跳转时间
- Struts中取得DataSource可以作为一个参数传递给一个对象吗?
- 我公司(北京)招一名显示层工程师
- timer.schedule()无法苏醒执行timeTask???
- javascript有时不执行的问题!
- 菜鸟问题,JSP安装时的文件哪儿可以下载呀,偶找了一下午都没有找到呀,请大蛱指点~!!!
- 在java中如何向一个url发一个http请求,但在IE的地址栏中没有历史纪录
- 提问如何在select中实现下面的功能?谢谢!
public static String UnicodeToChinese(String s){
try{
if(s==null ¦ ¦s.equals("")) return "";
String newstring=null;
newstring=new String(s.getBytes("ISO8859_1"),"gb2312");
return newstring;
}
catch(UnsupportedEncodingException e)
{
return s;
}
}
public static String ChineseToUnicode(String s){
try{
if(s==null ¦ ¦s.equals("")) return "";
String newstring=null;
newstring=new String(s.getBytes("gb2312"),"ISO8859_1");
return newstring;
}
catch(UnsupportedEncodingException e)
{
return s;
}
}