I want to ping a target IP address and receive a response. To achieve this, I'm using windows command line in Java with runtime.exec method and process class. I'm getting the response using inputStreamReader.
My default charset is windows-1254, it's Turkish. When I receive it, the response contains Turkish characters but Turkish characters are not displayed correctly in the console.
I want to get a numeric value from the response I get but the value that I am searching for contains some Turkish characters, so when I look it up, I can't find it.
The codes are below, what I need to know is how to get the Turkish characters visible here:
runtime = Runtime.getRuntime();
process = runtime.exec(pingCommand);
BufferedReader bReader = new BufferedReader(
new InputStreamReader(process.getInputStream(), "UTF8"));
String inputLine;
while ((inputLine = bReader.readLine()) != null) {
pingResult += inputLine;
}
bReader.close();
process.destroy();
System.out.println(pingResult);
UTF8
. – Indecent