String vipName = new String(umf.getVipName().getBytes("ISO8859-1"),"GBK");//姓名
String vipAddr = new String(umf.getVipAddr().getBytes("ISO8859-1"),"GBK");//地址
朋友和我说写这个就可以,但是谁能告诉我写在哪里,直接写在action里报错
String vipAddr = new String(umf.getVipAddr().getBytes("ISO8859-1"),"GBK");//地址
朋友和我说写这个就可以,但是谁能告诉我写在哪里,直接写在action里报错
你写进去就可以了或者你写一个静态方法,存储的时候都调用一下:
public static String fomatString(String string, String patten) {
String result = null;
if (string == null) {
return null;
}
if (patten == null) {
patten = "GBK";
}
try {
result = new String(string.getBytes("ISO8859-1"), "GBK");
} catch (UnsupportedEncodingException e) {
}
return result;
}
我是s2sh的框架,我是在前台写注册的时候前台写进oracle库里的中文都变成乱码了,我不知道怎么弄大家说你们的方法也行,这个我有点整部太明白了
在群里已经有人告诉我了
谢谢大家的支持