/**
* getGBString method convert String to ISO-8859-1 String
*/
public static String getGBString(String srcStr) {
String rtStr = srcStr;
if ( rtStr != null ) {
try {
rtStr = new String(rtStr.getBytes("ISO8859-1"));
} catch (Exception e) {
}
}
return rtStr;
}
用这方法在jsp中对表单中读取的中文信息进行处理再存入数据库,
* getGBString method convert String to ISO-8859-1 String
*/
public static String getGBString(String srcStr) {
String rtStr = srcStr;
if ( rtStr != null ) {
try {
rtStr = new String(rtStr.getBytes("ISO8859-1"));
} catch (Exception e) {
}
}
return rtStr;
}
用这方法在jsp中对表单中读取的中文信息进行处理再存入数据库,
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货