命令行上执行可以正确出文件。java执行却不行?大家帮手找找原因
String strCommand = "iconv -f GB2312 -t UTF-8 "+ strFileName1+" -o "+strFileName;
//String[] strCommand = {"/bin/bash /usr/bin/iconv -f GB2312 -t UTF-8 " + strFileName1+" -o "+strFileName};
System.out.println(strCommand);
Runtime rt = Runtime.getRuntime();
Process proc = rt.exec(strCommand);
InputStream stderr = proc.getErrorStream();
InputStreamReader isr = new InputStreamReader(stderr);
BufferedReader br = new BufferedReader(isr);
String line = null;
System.out.println("<ERROR>");
while ( (line = br.readLine()) != null)
System.out.println(line);
System.out.println("</ERROR>");
int exitVal = proc.waitFor();