public static String coverToGb(String str){
String s="";
try{
s=new String(str.getBytes("8859_1"),"gb2312");
}catch(Exception ex){
System.err.println("无法正确转换编码!");
}
return s;
}
String s="";
try{
s=new String(str.getBytes("8859_1"),"gb2312");
}catch(Exception ex){
System.err.println("无法正确转换编码!");
}
return s;
}
就把这行:s=new String(str.getBytes("8859_1"),"gb2312");就该为:
s=new String(str.getBytes("gb2312"),"8859_1");肯定行,我作过类似的。