title: java.util.Scanner to read files with different character encoding
body: <p>I use <code>Java</code> to read list of files. Some of these has different encoding, <code>ANSI</code> instead of <code>UTF-8</code>. <code>java.util.Scanner</code> is unable to read these files and get empty output string.
  I tried another approach:</p>
  
  <pre><code>                FileInputStream fis = new FileInputStream(my_file);
                  BufferedReader br = new BufferedReader(new InputStreamReader(fis));
                  InputStreamReader isr = new InputStreamReader(fis);
                  isr.getEncoding();
  </code></pre>
  
  <p>I am not sure how to change character encoding in case of <code>ANSI</code> ones. UTF-8 and ANSI files are mixed in same folder. I try to use Apache Tika for this.
  After I get encoding of file, I use <code>Scanner</code>, but I get empty output.</p>
  
  <pre><code>Scanner scanner = new Scanner(my_file, detector.getCharset().toString());
  line = scanner.nextLine();
  </code></pre>