title: Special Characters Lost in Process InputStream
body: <p>This isn't a repeat of a previous question, I have found out the issue is with the Process.</p>
  
  <p>I have a problem with my program whereby special characters are seemingly lost in the InputStream of a Java Process.</p>
  
  <p>The code I am using is as follows:</p>
  
  <pre><code>String command = "/usr/local/bin/getTitle &lt;URL&gt;";
  Process shellCommand = Runtime.getRuntime().exec(command);
  BufferedReader stdInput = new BufferedReader(new InputStreamReader(shellCommand.getInputStream(), "UTF-8"));
  String output = null;
  while ((output = stdInput.readLine()) != null) {
      System.out.println(output);
  }
  </code></pre>
  
  <p>If I run the 'command' from the command line, I get the following output:</p>
  
  <pre><code>PSY_-_GANGNAM_STYLE_(강남스타일)_M_V
  </code></pre>
  
  <p>However, the output of System.out.println(output); is as follows:</p>
  
  <pre><code>PSY_-_GANGNAM_STYLE_()_M_V
  </code></pre>
  
  <p>And this completely breaks my program.</p>
  
  <p>I'm completely stumped, and I haven't found anything even remotely related to this in my search. Any help greatly appreciated! Thanks in advance.</p>
  
  <p><strong>UPDATE:</strong></p>
  
  <p>If I change command as follows:</p>
  
  <pre><code>String command="echo 'PSY_-_GANGNAM_STYLE_(강남스 타일)_M_V'";
  </code></pre>
  
  <p>Then when printing the output the special characters are displayed correctly. Does this help in understanding where the problem lies?</p>