title: Reading unicode character in java
body: <p>I'm a bit new to java, When I assign a unicode string to </p>
  
  <pre><code>  String str = "\u0142o\u017Cy\u0142";
    System.out.println(str);
  
    final StringBuilder stringBuilder = new StringBuilder();
    InputStream inStream = new FileInputStream("C:/a.txt");
    final InputStreamReader streamReader = new InputStreamReader(inStream, "UTF-8");
    final BufferedReader bufferedReader = new BufferedReader(streamReader);
    String line = "";
    while ((line = bufferedReader.readLine()) != null) {
        System.out.println(line);
        stringBuilder.append(line);
    }
  </code></pre>
  
  <p>Why are the results different in both cases the file a.txt also contains the same string. but when i print output of the file it prints <code>z\u0142o\u017Cy\u0142</code> instead of the actual unicode characters. Any idea how do i do this if i want to file content also to be printed as string is being printed.</p>