写一个方法转码,给你两个方法,你可以直接用: static public String GBKToISO88591( String str ){
if( str == null ) return str;
try{
return new String( str.getBytes( "GBK" ), "8859_1" );
}
catch( Exception usex ){
return str;
}
} static public String ISO88591ToGBK( String str ){
if( str == null ) return str;
try{
return new String( str.getBytes( "8859_1" ), "GBK" );
}
catch( Exception usex ){
return str;
}
}
if( str == null ) return str;
try{
return new String( str.getBytes( "GBK" ), "8859_1" );
}
catch( Exception usex ){
return str;
}
} static public String ISO88591ToGBK( String str ){
if( str == null ) return str;
try{
return new String( str.getBytes( "8859_1" ), "GBK" );
}
catch( Exception usex ){
return str;
}
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货