I want to run a python script using the Process
class and display its output.
However Java is printing the characters accented like a diamond with a question mark inside.
ProcessBuilder processBuilder = new ProcessBuilder(command.split(" "));
processBuilder.directory(workingDirectory);
Process process = processBuilder.start();
try {
BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream()));
String output;
while ((output = reader.readLine()) != null) System.out.println(output);
reader.close();
} catch (IOException e) {
e.printStackTrace();
}
How do I solve this problem? If possible platform-independent.