报异常了是乱码的,不知道是什么错 ,修改异常编码格式
public static void main(String args[]) throws UnsupportedEncodingException {
try {
} catch (Exception e) {
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw);
e.printStackTrace(pw);
String msg = sw.toString();
System.out.println(" 内容: \r\n"
+ new String(msg.getBytes("ISO-8859-1"), "GBK"));
}
}