title: Java unable to read files with some "special" characters
body: <p>I wrote a java program to print the length of files in Java</p>
  
  <pre><code>  import java.io.File;
    import java.io.IOException;
    import java.nio.charset.Charset;
    import java.nio.file.Files;
  
    public class FTPTest {
            public static void main(String args[]) throws IOException {
                    File dirFile = new File("/home/chandakv/Desktop/test/vishal");
                    File[] ab = dirFile.listFiles();
                    for (int i = 0; i &lt; ab.length; i++) {
                            System.out.println(ab[i].getName() + "\t" + ab[i].length());
                    }
            }
    }
  </code></pre>
  
  <p>It works fine with normal files but with one file having the file name:</p>
  
  <p><strong>bjliretimessitb_u.'192.168.200.38' ?Ïµ? ?Ú²????? (Y).lnk</strong></p>
  
  <p>It is unable to read that file. If I am renaming that file (even removing any valid characters) it is working as expected. Till now, I am able to figure out that <strong>.lnk</strong> is not the problem and when renaming the file, the Linux explorer converts the encoding to ASCII so the file is being processed.</p>
  
  <p>But, how to process the file normally without modifying its name.</p>
  
  <p>FYI, on running the above program, </p>
  
  <pre><code>file.isFile() -&gt; Returns false
  file.isReadable() -&gt; Returns false
  file.length() -&gt; Returns 0
  </code></pre>
  
  <p>And on linux "ls -l" shows file size as 207 bytes.</p>