java中文乱码
1、
System.setProperty("jna.encoding","GBK")
2、
StringBuilder stringBuilder = new StringBuilder(); Process process = null; try { process = Runtime.getRuntime().exec(cmdCommand); BufferedReader bufferedReader = new BufferedReader( new InputStreamReader(process.getInputStream(), "GBK")); String line = null; while((line=bufferedReader.readLine()) != null) { stringBuilder.append(line+"\n"); c.jDisplayText.append(line+"\n"); } return stringBuilder.toString(); } catch (Exception e) { e.printStackTrace(); return null; }