mysql lation 转码

public static String toGBK(String strvalue) {
try {
if (strvalue == null) {
return "";
} else {
strvalue = new String(strvalue.getBytes("ISO-8859-1"), "GBK").trim();
return strvalue;
}
} catch (Exception e) {
return "";
}
}

public static String tolatin(String strvalue) {
try {
if (strvalue == null) {
return "";
} else {
strvalue = new String(strvalue.getBytes("GBK"), "ISO-8859-1").trim();
return strvalue;

}
} catch (Exception e) {
return "";
}
}

你可能感兴趣的:(mysql)