这个是好久以前留下来的 现在回头一看 实在是......... :?
[code] public static String getCharset() {
return "iso-2022-jp";
}
public String iso2gb(String qs) {
try {
if (qs == null)
return "NULL";
else {
return new String(qs.getBytes("iso-8859-1"), "gb2312");
}
}
catch (Exception e) {
System.err.println("iso2gb error・" + e.getMessage());
}
return "NULL";
}
public String gb2iso(String qs) {
try {
if (qs == null)
return "NULL";
else {
return new String(qs.getBytes("gb2312"), "iso-8859-1");
}
}
catch (Exception e) {
System.err.println("gb2iso error・" + e.getMessage());
}
return "NULL";
}[/code]
[code] public static String getCharset() {
return "iso-2022-jp";
}
public String iso2gb(String qs) {
try {
if (qs == null)
return "NULL";
else {
return new String(qs.getBytes("iso-8859-1"), "gb2312");
}
}
catch (Exception e) {
System.err.println("iso2gb error・" + e.getMessage());
}
return "NULL";
}
public String gb2iso(String qs) {
try {
if (qs == null)
return "NULL";
else {
return new String(qs.getBytes("gb2312"), "iso-8859-1");
}
}
catch (Exception e) {
System.err.println("gb2iso error・" + e.getMessage());
}
return "NULL";
}[/code]