title: How to read UTF 8 encoded file in java with turkish characters
body: <p>I am trying to read a UTF-8 encoded txt file, which has some turkish characters. Basically I am have written an axis based web service, which reads this file and send the output back as a string. Somehow I am not able to read the characters properly. The code is very simple as mentioned here:</p>
  
  <pre><code>import java.io.BufferedReader;
  import java.io.IOException;
  import java.io.InputStream;
  import java.io.InputStreamReader;
  import java.nio.charset.Charset;
  import java.nio.charset.CharsetDecoder;
  import java.nio.charset.CodingErrorAction;
  
  public class TurkishWebService {
  
      public String generateTurkishString() throws IOException {
          InputStream isr = this.getClass().getResourceAsStream(
                  "/" + "turkish.txt");
  
          BufferedReader in = new BufferedReader(new InputStreamReader(isr,
                  "UTF8"));
          String str;
  
          while ((str = in.readLine()) != null) {
              System.out.println(str);
          }
  
          in.close();
          return str;
      }
  
      public String normalString() {
          System.out.println("webService normal text");
          return "webService normal text";
      }
  
      public static void main(String args[]) throws IOException {
          new TurkishWebService().generateTurkishString();
      }
  }
  </code></pre>
  
  <p>Here are the contents of turkish.txt, just one line</p>
  
  <pre><code>Assalğçğıİİööşş
  </code></pre>
  
  <p>I am getting the stdout as </p>
  
  <pre><code>Assal?τ????÷÷??
  </code></pre>
  
  <p>Please suggest what am I doing wrong here.</p>